Re: [R] Question on sapply

2011-02-09 Thread Khanvilkar, Shashank
shank Cc: r-help@r-project.org Subject: Re: [R] Question on sapply Try this: lapply(z, as.numeric) On Wed, Feb 9, 2011 at 5:16 PM, Khanvilkar, Shashank mailto:skhan...@qualcomm.com>> wrote: Hello All, Thanks in advance for all help I have the following vector of strings that I want to split

Re: [R] Question on sapply

2011-02-09 Thread Khanvilkar, Shashank
Sorry.. my bad.. I should have done z = lapply(z, as.numeric) That works. Shank From: Khanvilkar, Shashank Sent: Wednesday, February 09, 2011 1:33 PM Cc: r-help@r-project.org Subject: RE: [R] Question on sapply Thanks, Nopes.. Does not seem to work. > lapply(z, as.numeric) [[1]] [1] 1 1

Re: [R] Question on sapply

2011-02-09 Thread Henrique Dallazuanna
Try this: lapply(z, as.numeric) On Wed, Feb 9, 2011 at 5:16 PM, Khanvilkar, Shashank wrote: > Hello All, > Thanks in advance for all help > I have the following vector of strings that I want to split.. > > > y = c("1/1","2/2", "3/3", "4/4") > > y > [1] "1/1" "2/2" "3/3" "4/4" > > z = strsplit(y,

[R] Question on sapply

2011-02-09 Thread Khanvilkar, Shashank
Hello All, Thanks in advance for all help I have the following vector of strings that I want to split.. > y = c("1/1","2/2", "3/3", "4/4") > y [1] "1/1" "2/2" "3/3" "4/4" > z = strsplit(y,"/") > z [[1]] [1] "1" "1" [[2]] [1] "2" "2" [[3]] [1] "3" "3" [[4]] [1] "4" "4" Now how do I convert all