[R] converting character to numeric

2011-06-21 Thread Alina Sheyman
I'm trying to convert data from character to numeric.

 I've imported data as a csv file, I'm assuming that the import is a
database - are all the columns in  a database considered vectors  and that
they can be  operated on individually
Therefore I've tried the following
mydata - as.numeric(mydata$apples)

when i then look at mydata again  the named column is still in character
format
 if i do mydata2 - as.numeric(mydata$apples)
the new object mydata2 is empty.

Am i missing something about the structure of R?

alina

[[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.


[R] importing a file

2011-06-20 Thread Alina Sheyman
I haven't used R in a couple of years, and now  am trying something as
simple as importing a csv file and am running into problems right away.
*
mydata - read.csv (Wordata1.csv, sep=)
Error in read.table(file = file, header = header, sep = sep, quote = quote,
:
  object 'Wordata1.csv' not found

*I've tried in both as as read.csv and read.table and still get the same
message.
I've double-checked that I'm in the right directory using getwd() and
indeed I am.

Any ideas on what might be causing this error message? Can it be something
in the format of the file?
(I've looked through the archives and didn't see anything that might explain
it)

thank  you!!!
Alina

[[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] importing a file

2011-06-20 Thread Alina Sheyman
that was it, thank you!!!

On Mon, Jun 20, 2011 at 5:23 PM, Sarah Goslee sarah.gos...@gmail.comwrote:

 R is looking for an R object named Wordata1.csv that contains your file
 name.

 Instead you want:
 mydata - read.csv (Wordata1.csv, sep=)

 Sarah

 On Mon, Jun 20, 2011 at 5:16 PM, Alina Sheyman alina...@gmail.com wrote:
  I haven't used R in a couple of years, and now  am trying something as
  simple as importing a csv file and am running into problems right away.
  *
  mydata - read.csv (Wordata1.csv, sep=)
  Error in read.table(file = file, header = header, sep = sep, quote =
 quote,
  :
   object 'Wordata1.csv' not found
 
  *I've tried in both as as read.csv and read.table and still get the same
  message.
  I've double-checked that I'm in the right directory using getwd() and
  indeed I am.
 
  Any ideas on what might be causing this error message? Can it be
 something
  in the format of the file?
  (I've looked through the archives and didn't see anything that might
 explain
  it)
 
  thank  you!!!
  Alina


 --
 Sarah Goslee
 http://www.functionaldiversity.org


[[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.


[R] Europe zip code shapefiles

2009-04-07 Thread Alina Sheyman
Hi all,
  I'm looking for zip code shapefiles for Italy and France.Does anyone know
where I might be able to find these?


thank you!

[[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.


[R] target of assignment expands to non-language object

2009-03-31 Thread Alina Sheyman
I'm running the following code

numbers - 1:50
for (i in 1:50)
assign(paste(model,numbers[i]),i)-(lm(temp$Overall.Scaled.Score~temp$raw.score))

where I want R to create 50 different models-1:50, but get the following
error message

target of assignment expands to non-language object. I've tried it with
 paste(model,numbers[i]))-(lm(temp$Overall.Scaled.Score~temp$raw.score)
and get the same error.

Does anyone know what the problem is or whether there's a better way to get
at what I'm trying to do?

[[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.


[R] mapping lat and long with maps package

2009-03-04 Thread Alina Sheyman
I am trying to overlay a data frame with lat and longitude(which refer to
zip codes) on the map of US that I get by using map (states).
Is there anyway to do this or do I have to resort to using maptools?

thank you

[[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] mapping lat and long with maps package

2009-03-04 Thread Alina Sheyman
When I run this code i get the following error messages

Error in mapgetg(database, gon, as.polygon, xlim, ylim) :
  NA/NaN/Inf in foreign function call (arg 6)
In addition: Warning messages:
1: In min(x, na.rm = na.rm) :
  no non-missing arguments to min; returning Inf
2: In max(x, na.rm = na.rm) :
  no non-missing arguments to max; returning -Inf

On Wed, Mar 4, 2009 at 5:27 PM, David Winsemius dwinsem...@comcast.netwrote:

 The example on the help page would seem to be completely on point if I
 understand your desire to be plotting text at particular long,lat
 coordinates:

 ?map

 text(long, lat, text)

 #
 data(ozone)
 map(state, xlim = range(ozone$x), ylim = range(ozone$y))
 text(ozone$x, ozone$y, ozone$median)
 box()

 --
 David Winsemius


 On Mar 4, 2009, at 5:04 PM, Alina Sheyman wrote:

  I am trying to overlay a data frame with lat and longitude(which refer to
 zip codes) on the map of US that I get by using map (states).
 Is there anyway to do this or do I have to resort to using maptools?

 thank you

[[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.




[[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.


[R] colored maps again

2009-02-19 Thread Alina Sheyman
I'm trying to create a colored map that would show the number of students
per state.
My data frame consists of two columns - state and count.
I'm using the following code

library(maps)
map(usa)
library(plotrix)
state.col-color.scale(gre$count,0,0,c(0,1))
 map(state,fill=TRUE,col=state.col)

I'm getting a map, but the values are not being mapped to correct states.
What do I need to do to fix that?

[[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.


[R] RcolorBrewer

2009-02-18 Thread Alina Sheyman
I've downloaded the RcolorBrewer package, but when I try to run
mypalette-brewer.pal(7,Greens)

(or any other command with brewer.pal)

I get the following error message - Error: could not find function
brewer.pal

Does anyone know why that's happening? Is there smth else I need to
download?

thank you

[[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] RcolorBrewer

2009-02-18 Thread Alina Sheyman
I figured it out
thanks

On Wed, Feb 18, 2009 at 3:50 PM, Domenico Vistocco visto...@unicas.itwrote:

 Alina Sheyman wrote:

 I've downloaded the RcolorBrewer package, but when I try to run
 mypalette-brewer.pal(7,Greens)

 (or any other command with brewer.pal)

 I get the following error message - Error: could not find function
 brewer.pal

 Does anyone know why that's happening? Is there smth else I need to
 download?


 Do you have loaded the package?
 library(RcolorBrewer)

  thank you

[[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.






[[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.


[R] color maps with counts

2009-02-18 Thread Alina Sheyman
I have yet another question concerning maps.
This time I want to create a colored map of number of students by state.
Can this be done using palettes in Rcolor brewer, is there some other way?

I've been looking through R archives, but am still really at a loss here, so
all help will be much appreciated.

Thank you!

[[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.


[R] creating a map

2009-02-17 Thread Alina Sheyman
I'm trying to create a fairly basic map using R. What i want to get is the
map of the country with circles representing a count of students in each
state.
What I've done so far is as following -
  map(state)
 symbols(data1$count,circles=log(data1$count)*3,fg=col,bg=col,add=T,inches=F)

this gives me the map of the country, but one that's not populated by my
counts.
Does anyone know what I'm doing wrong?

Also, if anyone can recommend a good reference for creating maps in R, I'd
really appreciate that.

thank you

[[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] creating a map

2009-02-17 Thread Alina Sheyman
Thanks Greg,
  do you know where i can find the sate.center dataset that you mention?

On Tue, Feb 17, 2009 at 12:28 PM, Greg Snow greg.s...@imail.org wrote:

 You need to give the symbols function the locations where you want the
 centers of the circles to be.  Some datesets with map information also have
 centers of the states that you can use, for the USA, there is the
 state.center dataset that may work for you, or the maptools package function
 get.Pcent will compute a center for polygons (there are probably other
 similar functions in other packages).

 For adding circles to a map of the USA, you may want to look at the
 state.vbm data in the TeachingDemos package (works with maptools package),
 but you will need to computer the centers of the polygons, they don't match
 state.center or others.

 Hope this helps,

 --
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 greg.s...@imail.org
 801.408.8111


  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
  project.org] On Behalf Of Alina Sheyman
  Sent: Tuesday, February 17, 2009 9:53 AM
  To: r-help@r-project.org
  Subject: [R] creating a map
 
  I'm trying to create a fairly basic map using R. What i want to get is
  the
  map of the country with circles representing a count of students in
  each
  state.
  What I've done so far is as following -
map(state)
 
  symbols(data1$count,circles=log(data1$count)*3,fg=col,bg=col,add=T,inch
  es=F)
 
  this gives me the map of the country, but one that's not populated by
  my
  counts.
  Does anyone know what I'm doing wrong?
 
  Also, if anyone can recommend a good reference for creating maps in R,
  I'd
  really appreciate that.
 
  thank you
 
[[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.


[[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.


[R] Replacing dates with consecutive observations

2009-01-21 Thread Alina Sheyman
I am working with a list of dates and I would like to replace each date with
the one that comes after, ie. 1/1/07 will become 1/5/07, 1/5/07 will become
1/7/07, etc. The number of days between my dates always varies, so I can't
just increase each one by 5 days or  so. Does anyone know of a way I can do
this in R?

thank you

[[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.


[R] (no subject)

2008-12-04 Thread Alina Sheyman
I'm trying to establish the occurrence of a specific day of the week in a
given month.
Namely I want to know if a specific Tuesday was the 2nd,3rd Tuesday in a
month.

Is there a good way to this in R?

thank you,
Alina  Sheyman

[[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.


[R] occurrence of a weekday in a month

2008-12-04 Thread Alina Sheyman
I'm trying to establish the occurrence of a specific day of the week in a
given month.
Namely I want to know if a specific Tuesday was the 2nd,3rd Tuesday in a
month.

Is there a good way to this in R?

thank you,
Alina  Sheyman

[[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.