Re: [R] space in column name

2009-07-19 Thread cls59
Farrel Buchinsky-3 wrote: > > I sifted some more and read about a workaround for the problem. I could > simply rename the columns so that there were no more spaces > names(alltime) <-gsub(" ",".", names(alltime)) > That would certainly be a solution. The method I was trying to demonstrate is t

Re: [R] space in column name

2009-07-19 Thread jim holtman
use 'make.names' > make.names("MIDDLE EAR EXPLORE") [1] "MIDDLE.EAR.EXPLORE" On Sun, Jul 19, 2009 at 2:32 PM, Farrel Buchinsky wrote: > I read a table from Microsoft Access using RODBC. Some of the variables had > a name with a space in it. > R has no problem with it but I do. > I cannot find ou

Re: [R] space in column name

2009-07-19 Thread Farrel Buchinsky
I sifted some more and read about a workaround for the problem. I could simply rename the columns so that there were no more spaces names(alltime) <-gsub(" ",".", names(alltime)) > names(alltime) [1] "ID""LVL7" "Ref.Pv.No" "Ref.Pv.Name" "DOS" "Pt.Last.Name" "Pt

Re: [R] space in column name

2009-07-19 Thread cls59
cls59 wrote: > > The following might work: alltime[grep("MIDDLE EAR EXPLORE",alltime[[ "CPT Desc ]] ] -Charlie ACK! Terribly sorry about the double post- but I forgot to close the quote. It should be: alltime[grep("MIDDLE EAR EXPLORE",alltime[[ "CPT Desc" ]] ] Maybe I should wait unt

Re: [R] space in column name

2009-07-19 Thread cls59
Farrel Buchinsky-3 wrote: > > I read a table from Microsoft Access using RODBC. Some of the variables > had > a name with a space in it. > R has no problem with it but I do. > I cannot find out how to specify the space > > names(alltime) > [1] "ID""LVL7" "Ref Pv No" "R

[R] space in column name

2009-07-19 Thread Farrel Buchinsky
I read a table from Microsoft Access using RODBC. Some of the variables had a name with a space in it. R has no problem with it but I do. I cannot find out how to specify the space names(alltime) [1] "ID""LVL7" "Ref Pv No" "Ref Pv Name" "DOS" "Pt Last Name" "Pt