[R] A simple crop/clip of a png map

2015-10-30 Thread Jim Burke
I have a 5.76" x 5.75" png image which I would like to crop to some inch
size. To use as a report header (after placing some title text on it).

So how to use R to crop a nice rectangle from my image?

Thanks for your thoughts
Jim Burke

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] My simple ORDER is broken

2015-10-26 Thread Jim Burke
tmp_df[order(tmp_df$Democratic),]
   Precinct Last.Name Democratic Republican.Total Registered.Voters
2  2904 Open Seat  1015
NA 2903 Open Seat227  245  2035
3  2905 Open Seat 71  202   497


tmp_df[order(tmp_df[3]),]
   Precinct Last.Name Democratic Republican.Total Registered.Voters
2  2904 Open Seat  1015
NA 2903 Open Seat227  245  2035
3  2905 Open Seat 71  202   497

> tmp_df$Democratic[order(tmp_df$Democratic)]
[1] "1"   "227" "71"

What am I doing wrong? I would like the order below. I suspect the problem
lies with that NA to the left that R inserted somewhere along the line. So
how to reorder dataframe rows? Or get rid of that NA?
2  2904 Open Seat  1015
3  2905 Open Seat 71  202   497
NA 2903 Open Seat227  245  2035

Thanks,
Jim Burke

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Text in Spatial Polygrams

2015-08-25 Thread Jim Burke
I can do this fine for one polygram BUT a for-loop fails.The concept is
multiple lines within each polygon.  I am doing something sub-genius.

ONE POLYGON
   plot(all_pcts_osm_sp[i,], add = FALSE, lwd=.5, border='blue')
   hght - strheight(Here)
   MyLines - list(
  bquote( .(all_pcts_osm_sp$PCT[i]) ),
  bquote( .(all_pcts_osm_sp$First_Name[i]) ),
  bquote( .(all_pcts_osm_sp$Last_Name[i]) ),
  bquote( .(all_pcts_osm_sp$Phone) ))
   text( all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[1]],
 all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[2]] - (hght * 1.5 *
seq(length(MyLines))),
 do.call(expression, MyLines))

ALL POLYGONS JUST DO NOT WORK.  PUZZLED? Help me please. Also ultimate
target is an OpenStreet (OSM) backdrop.

   tmp_sp_length - length(all_pcts_osm_sp)
   i = 1
   for(i in 1:tmp_sp_length) {
  hght - strheight(Here)
  MyLines - list(
 bquote( .(all_pcts_osm_sp$PCT[i]) ),
 bquote( .(all_pcts_osm_sp$First_Name[i]) ),
 bquote( .(all_pcts_osm_sp$Last_Name[i]) ),
 bquote( .(all_pcts_osm_sp$Phone) ))
  text( all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[1]],
 all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[2]] - (hght * 1.5 *
   seq(length(MyLines))),
 do.call(expression, MyLines))
   }

All your comments, ideas, and thoughts are appreciated.
Thanks
Jim Burke

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Fwd: Text in Spatial Polygrams

2015-08-25 Thread Jim Burke
Setup for the OSM Map is below

   ul - as.vector(cbind(bbox(all_pcts_osm_sp) [2,2], bbox(all_pcts_osm_sp)
[1,1]))
   lr - as.vector(cbind(bbox(all_pcts_osm_sp) [2,1], bbox(all_pcts_osm_sp)
[1,2]))
   map_types - c(osm, maptoolkit-topo, waze, mapquest,
mapquest-aerial,
  bing, stamen-toner, stamen-terrain, stamen-watercolor,
osm-german,
  osm-wanderreitkarte, mapbox, esri, esri-topo, nps,
apple-iphoto,
  skobbler, opencyclemap, osm-transport, osm-public-transport,
  osm-bbike, osm-bbike-german)
   MyMap - openmap(ul,lr, zoom = NULL, minNumTiles = 16L, type =
map_types[1] ,mergeTiles = TRUE)
   # now plot the layer and the backdrop
   par(mar = c(0,0,0,0))
  plot(MyMap)
  plot(spTransform(all_pcts_osm_sp, osm()), add = FALSE, lwd=.5,
border='blue')

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] aggravating aggregate

2015-08-05 Thread Jim Burke
Greetings R mavens (and that's YOU). Given the following how on earth do I
aggregate and sum duplicate PCT rows into one combined row per PCT?

Data types
 str(xxx)
'data.frame':   9 obs. of  3 variables:
 $ Registered: int  1327 2129 10 433 5 166 1784 17 787 700
 $ GA_Total  : int  127 150 0 32 1 76 153 7 31 23
 $ PCT   : chr  1120 1121 1121 1122 ...

Data desired to be summarized
Registered GA_Total  PCT
1327   127  1120
2129   150  1121
  10 0  1121
 43332  1122
   5 1  1124
 16676  1125
1784   153  1125
  17 7  1125
 78731  1126

Desired summary
Registered GA_Total  PCT
1327   127  1120
2139   150  1121
 43332  1122
   5 1  1124
1967   236  1125
 78731  1126

When answered this please make the reply suitable as a tutorial for many
other puzzled R aggregate people. Scarce useful examples on the
web. Aggregate
is a basic for statistical programming. Yet even ISBN 978-1461471370 An
Introduction to Statistical Learning with R does not appear to delve into
aggerate. Basic simple and useful fully explained answers. If you have to
use apply then explain why.

Thanks
Jim Burke

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Trouble with simple R list concatenations

2011-03-20 Thread Jim Burke
PROBLEM How can I concatenate the following lists into ONE LIST WITHOUT 
the unhelpful message operator is invalid for atomic vectors?  Combine 
as a data frame?


EXAMPLE

Birth_Date  - NULL
Birth_Date[1:3] - c(01/17/1939,01/17/1949, 01/17/1959)
Later_Date  - NULL
Later_Date[1:3] - c(01/17/2009, NA, NA)
Names   - NULL
Names[1:3]  - c(Martha Smith, John Doe, Rufus Nobody)

#this does not work
family  - c(Birth_Date, Later_Date, Names)
family$Birth_Date
Error in family$Birth_Date : $ operator is invalid for atomic vectors

FUNCTIONALLY DESIRED FROM THE FINAL COMBINED data frame
I would appreciate being able to do the following with the final list or 
data frame.

1. Be able to address names using $
2. Be able to change individual variables like the NA's to a proper date 
perhaps like


family$Later_Date[[3]] - toString(format(Sys.time(),%m/%d/%Y), width=10)

Thanks, your help would is gratefully accepted,
Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Lattice, combine histogram and line graph

2011-01-09 Thread Jim Burke

Hello everyone,

I have a simple histogram of gasoline prices going back a few years that 
I want to insert a line graph of consumer price index (cpi) over the 
histogram.  I have looked through the Lattice book by Deepayan Sarkar 
but don't see anything there. How might this be done? An example would 
be wonderful.


Current code snippet follows. For example additional field to add as a 
line graph would be a cpi calculation like gas_data$regular * (2010_cpi 
/ gas_data$year ).


xyplot( regular ~ as.Date(gas_data$dates,%b %d, %Y) , data = gas_data,
   type = c(g, h ))

Thanks,
Jim Burke

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Lattice, combine histogram and line graph

2011-01-09 Thread Jim Burke

Thanks Josh, Gabor, and David,

I appreciate your suggestions and the time you took to think about this. 
This was all most helpful. Gabor I will look at the zoo package soon. 
Sounds interesting.


Below is what worked for me from Josh to overlay a line graph on a 
histogram.



obj1 - xyplot( regular ~ as.Date(gas_data$dates,%b %d, %Y) , data = 
gas_data,

type = c(g, h ) )

obj2 - xyplot( (gas_data$regular * (cpi_2010 / gas_data$cpi) ) ~ 
as.Date(gas_data$dates,%b %d, %Y) , data = gas_data,

type = c( l ), col = black )

obj1 + as.layer(obj2, style = 2, axes = NULL, )


Have a great week,
Jim


Joshua Wiley wrote:

Hi Jim,

Some example data would help us.  I typically think of a histogram as
the frequency of values falling within a certain range (determined by
bins).  Since they are univariate plots, I'm not sure how you are
planning on adding a line graph to that.  If you just want bars of the
average gasoline price at different years, perhaps something along
these lines would work for you:

## Load required packages
require(lattice)
require(latticeExtra)

## Sample Data
dat - data.frame(year = 1996:2010,
  x1 = rnorm(15, 3, .2), x2 = rnorm(15, 200, 1))

## Base xyplot (not a histogram) adding a layer with different y axis
xyplot(x1 ~ year, data = dat, type = h) +
  as.layer(xyplot(x2 ~ year, data = dat, type = l, col = black),
  y.same = FALSE)

## See
?xyplot
?as.layer
?hist # for info about histograms

HTH,

Josh

On Sun, Jan 9, 2011 at 5:13 PM, Jim Burke j.bu...@earthlink.net wrote:
  

Hello everyone,

I have a simple histogram of gasoline prices going back a few years that I
want to insert a line graph of consumer price index (cpi) over the
histogram.  I have looked through the Lattice book by Deepayan Sarkar but
don't see anything there. How might this be done? An example would be
wonderful.

Current code snippet follows. For example additional field to add as a line
graph would be a cpi calculation like gas_data$regular * (2010_cpi /
gas_data$year ).

xyplot( regular ~ as.Date(gas_data$dates,%b %d, %Y) , data = gas_data,
  type = c(g, h ))

Thanks,
Jim Burke

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.









__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Merge disparate lists

2010-10-27 Thread Jim Burke

My two lists look like below
Need an R code example that
combines the two.

l_one
key
2
1
2


l_two
ndx, descr
1, this
2, that
3, other
4, finis

My goal is a new list that looks
like below.
ndx descr
2   that
1   this
2   that

Thanks,
Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem installing new packages

2010-03-11 Thread Jim Burke

Hi everyone,

Using R 2.10.1 on Windows Vista. 

DOWNLOADED PACKAGES DO NOT INSTALL. I expect to see them in C:\Program 
Files\R\R-2.10.1\library  These files download (see below). And they are 
all in zip format. What am I doing wrong? Please help. All suggestions 
appreciated.


trying URL 
'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.10/RColorBrewer_1.0-2.zip'

Content type 'application/zip' length 23875 bytes (23 Kb)
opened URL
downloaded 23 Kb

package 'mnormt' successfully unpacked and MD5 sums checked
package 'mvtnorm' successfully unpacked and MD5 sums checked
package 'scatterplot3d' successfully unpacked and MD5 sums checked
package 'sn' successfully unpacked and MD5 sums checked
package 'pspline' successfully unpacked and MD5 sums checked
package 'akima' successfully unpacked and MD5 sums checked
package 'lme4' successfully unpacked and MD5 sums checked
package 'latticeExtra' successfully unpacked and MD5 sums checked
package 'copula' successfully unpacked and MD5 sums checked
package 'ellipse' successfully unpacked and MD5 sums checked
package 'gridBase' successfully unpacked and MD5 sums checked
package 'locfit' successfully unpacked and MD5 sums checked
package 'logspline' successfully unpacked and MD5 sums checked
package 'mapproj' successfully unpacked and MD5 sums checked
package 'maps' successfully unpacked and MD5 sums checked
package 'MEMSS' successfully unpacked and MD5 sums checked
package 'mlmRev' successfully unpacked and MD5 sums checked
package 'RColorBrewer' successfully unpacked and MD5 sums checked

The downloaded packages are in
   C:\Users\Owner\AppData\Local\Temp\RtmpvYKBW7\downloaded_packages

Thanks,
Jim Burke

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problem installing new packages

2010-03-11 Thread Jim Burke

Never mind, thanks

Jim Burke wrote:

Hi everyone,

Using R 2.10.1 on Windows Vista.
DOWNLOADED PACKAGES DO NOT INSTALL. I expect to see them in C:\Program 
Files\R\R-2.10.1\library  These files download (see below). And they 
are all in zip format. What am I doing wrong? Please help. All 
suggestions appreciated.


trying URL 
'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.10/RColorBrewer_1.0-2.zip' 


Content type 'application/zip' length 23875 bytes (23 Kb)
opened URL
downloaded 23 Kb

package 'mnormt' successfully unpacked and MD5 sums checked
package 'mvtnorm' successfully unpacked and MD5 sums checked
package 'scatterplot3d' successfully unpacked and MD5 sums checked
package 'sn' successfully unpacked and MD5 sums checked
package 'pspline' successfully unpacked and MD5 sums checked
package 'akima' successfully unpacked and MD5 sums checked
package 'lme4' successfully unpacked and MD5 sums checked
package 'latticeExtra' successfully unpacked and MD5 sums checked
package 'copula' successfully unpacked and MD5 sums checked
package 'ellipse' successfully unpacked and MD5 sums checked
package 'gridBase' successfully unpacked and MD5 sums checked
package 'locfit' successfully unpacked and MD5 sums checked
package 'logspline' successfully unpacked and MD5 sums checked
package 'mapproj' successfully unpacked and MD5 sums checked
package 'maps' successfully unpacked and MD5 sums checked
package 'MEMSS' successfully unpacked and MD5 sums checked
package 'mlmRev' successfully unpacked and MD5 sums checked
package 'RColorBrewer' successfully unpacked and MD5 sums checked

The downloaded packages are in
   C:\Users\Owner\AppData\Local\Temp\RtmpvYKBW7\downloaded_packages

Thanks,
Jim Burke

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] prompts and running means

2010-02-10 Thread Jim Burke

Perhaps the One R Tip a Day might be helpful.
The first part of this example saves a png file.

http://onertipaday.blogspot.com/2009/01/statistical-visualizations-part-2.html

Good luck,
Jim

RagingJim wrote:

Thanks mate, will get the zoo package ASAP. I have been working on the file
open/save part, and it works as planned except for one bit. When I save it,
it does not save as the relevant file type.

This is again my code:

require(tcltk)
fileName-tclvalue(tkgetSaveFile(filetypes={{PNG Files} {.png}} ))
png(fileName)
barplot(Ann,main=Annual Rainfail Data, xlab=Year,ylab=Rainfall
(mm),ylim=c(0,ymax),col=blue,space=0,names.arg=c(kent[,2]),
cex.names=0.8)
legend(topleft,c(This picture),bty=n)
dev.off()

When I go to save it, the corrent save window pops up, and it has the png
file format selected, yet when I type in a name and save, it is saved
without a file type. What am I doing wrong?

Thanks again for your help



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Simple if else statement problem

2009-11-13 Thread Jim Burke

Anna,

I think the else needs to be on the same line
as the curly bracket like this } else.

P1 - 1
P2 - 2

if( P2  P1)
{
   P-P2
} else
{
   P-P1
}

Good luck,
Jim

anna_l wrote:

Hello, I am getting an error with the following code:
if( P2  P1)
+ {
+ P-P2
+ }
  

else


Erro: unexpected 'else' in else
  

{


+ P-P1
+ }

I checked the syntax so I donĀ“t understand, I have other if else statements
with the same syntax working. Thanks in advance



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Turn dates into age

2009-11-08 Thread Jim Burke
To clarify.

Lets turn a date into an age. Given 05/29/1971 in mm/dd/
format. What is the year difference between then and today?
This would be the age requested that starts 05/29/1971 as
one.

Thanks,
Jim




David Winsemius wrote:

 On Nov 8, 2009, at 3:11 PM, frenchcr wrote:



 why do you use 365.25?


 As opposed to what?

 -- David

 dates-as.character(data[,date_commissioned]); # convert dates to
 characters
 #dates[1:10]
 #[1] 19910101 19860101 19910101 19860101 19910101 19910101
 19910101 19910101 19910101 19910101

 dateObs - as.Date(dates,format=%Y%m%d)
 #dateObs[1:10]
 #[1] 1991-01-01 1986-01-01 1991-01-01 1986-01-01 1991-01-01
 1991-01-01 1991-01-01 1991-01-01 1991-01-01 1991-01-01

 today - Sys.Date()
 x.date - as.Date(dateObs, format=%Y%m%d)

 AGE - round(as.vector(difftime(today , x.date, units='day') / 365.25))





 frenchcr wrote:


 it sure does thank you!


 will this work for you

 x - c('19910101', '19950302', '20010502')
 today - Sys.Date()
 x.date - as.Date(x, format=%Y%m%d)
 round(as.vector(difftime(today , x.date, units='day') / 365.25))
 [1] 19 15  9



 On Sun, Nov 8, 2009 at 2:44 PM,  frenc...@btinternet.com wrote:
 Hi Jim,

 Thanks for the quick reply...not sure what you mean by frame of
 reference(only been using R for 4 days)...to clarify, i need to 
 turn my
 dates from 1999-10-01 into 1999 then i subtract 2009 -1999 to get 
 an age
 of 10. The column im working on has 312,000 rows and some have NA 
 in them
 as we have no dates for that item.

 To recap, the column is just a bunch of dates with some field empty, i
 want to change the column from date of commision to age of asset

 Cheers
 Chris.




 jholtman wrote:

 What is the frame of reference to determine the age?   Check out
 'difftime'.

 On Sun, Nov 8, 2009 at 1:50 PM, frenchcr frenc...@btinternet.com 
 wrote:

 Ive got a big column of dates (also some fields dont have a date 
 so they
 have
 NA instead),
 that i have converted into date format as so...


 dates-as.character(data[,date_commissioned]); # converted dates to
 characters
 dates[1:10]
 [1] 19910101 19860101 19910101 19860101 19910101 19910101
 19910101 19910101 19910101 19910101

 dateObs - as.Date(dates,format=%Y%m%d)
 dateObs[1:10]
 [1] 1991-01-01 1986-01-01 1991-01-01 1986-01-01 1991-01-01
 1991-01-01 1991-01-01 1991-01-01 1991-01-01 1991-01-01



 Now i need to turn the dates into AGE, how do i do it? Im not worried
 about
 fractions of years, whole years would do.


 -- 
 View this message in context:
 http://old.nabble.com/Turn-dates-into-age-tp26256656p26256656.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




 -- 
 Jim Holtman
 Cincinnati, OH
 +1 513 646 9390

 What is the problem that you are trying to solve?

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.





 -- 
 View this message in context: 
 http://old.nabble.com/Turn-dates-into-age-tp26256656p26257435.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Basic question ( too broad for help topics).

2009-10-29 Thread Jim Burke

Thanks Ista,

Your suggestion worked like a charm.

Mark, thanks to you too. But don't worry about the data I sent to you.

Good night everyone,
Jim

Ista Zahn wrote:

Hi Jim,

out_df - my_df[ my_df$STREP %in% my_num, c(COUNTY, FIPS, STSEN,
STREP, PREC)]

should do the trick. See

?match

for details.

On Thu, Oct 29, 2009 at 1:53 AM, Jim Burke j.bu...@earthlink.net wrote:
  

I have searched help topics but don't know exactly what to search for.
Need to use my_num to find any matching STREPs in my_df

my_num -
c(101,102,103,104,105,107,108,112,113,114,115)

## my_df has 8,000 different STREPS in it.

##  I have a statement where I can select ONE item from data frame my_df
out_df - my_df[ my_df$STREP==101, c(COUNTY, FIPS, STSEN, STREP,
PREC)]

## A comparative SQL command
## SELECT
## COUNTY, FIPS, STSEN, STREP, PREC
## FROM my_df
## WHERE my_df.STREP
IN(101,102,103,104,105,107,108,112,113,114,115)
## ORDER BY STREP;

Thanks for any help,
Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.









__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Basic simple question

2009-10-29 Thread Jim Burke

I have a statement like below.

my_num - 
c(101,102,103,104,105,107,108,112,113,114,115)


my_df has 8,000 different STREPS in it.

I have a statement where I can select ONE item from data frame my_df
txhd_df - prec_dist_df[ my_df$STREP==101, c(COUNTY, FIPS, 
STSEN, STREP, PREC)]


I would like to make R compare and deliver only the STREPS that are in 
my_num.


A comparative SQL command WHERE STREP 
IN(101,102,103,104,105,107,108,112,113,114,115)


Thanks for any help,
Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] The system cannot find the file specified

2009-10-29 Thread Jim Burke

I think your are using R 2.10.0.

I get similar messages when I have too many resources in use. Like FireFox
eating memory and CPU.

When you get this message go look in your R installation library 
subdirectory.
You will see a weird number as a folder name. Under that folder is the 
package you
were trying to install. Simply copy that package name folder to the 
correct folder
location for the other packages in library. Then clean up by removing 
that weird

folder name.

Hope this helps,
Jim

Mark Knecht wrote:

What is the problem here? I did an install package from the Rgui menu.
Windows Vista

SNIP

trying URL 
'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.9/mvtnorm_0.9-8.zip'
Content type 'application/zip' length 236089 bytes (230 Kb)
opened URL
downloaded 230 Kb

trying URL 
'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.9/QRMlib_1.4.4.zip'
Content type 'application/zip' length 2369023 bytes (2.3 Mb)
opened URL
downloaded 2.3 Mb

package 'robustbase' successfully unpacked and MD5 sums checked
package 'fUtilities' successfully unpacked and MD5 sums checked
package 'fEcofin' successfully unpacked and MD5 sums checked
package 'fCalendar' successfully unpacked and MD5 sums checked
package 'fSeries' successfully unpacked and MD5 sums checked
package 'mvtnorm' successfully unpacked and MD5 sums checked
package 'QRMlib' successfully unpacked and MD5 sums checked
Error in normalizePath(path) :
  path[1]=C:\Program Files\R\R-2.9.2\library/QRMlib: The system
cannot find the file specified

SNIP

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Basic question ( too broad for help topics).

2009-10-28 Thread Jim Burke

I have searched help topics but don't know exactly what to search for.
Need to use my_num to find any matching STREPs in my_df

my_num - 
c(101,102,103,104,105,107,108,112,113,114,115)


## my_df has 8,000 different STREPS in it.

##  I have a statement where I can select ONE item from data frame my_df
out_df - my_df[ my_df$STREP==101, c(COUNTY, FIPS, STSEN, 
STREP, PREC)]


## A comparative SQL command
## SELECT
## COUNTY, FIPS, STSEN, STREP, PREC
## FROM my_df
## WHERE my_df.STREP 
IN(101,102,103,104,105,107,108,112,113,114,115)

## ORDER BY STREP;

Thanks for any help,
Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.