Re: [R] modify the levels of a variable

2010-03-10 Thread Henrique Dallazuanna
You can try this also: as.data.frame(lapply(subset(data, X == 'a'), '[', drop = TRUE)) On Wed, Mar 10, 2010 at 6:35 PM, clee wrote: > > If anyone can help with this, I would greatly appreciate it. > > When I subset a dataframe, and then create a table of on of the column > variables, the levels

Re: [R] modify the levels of a variable

2010-03-10 Thread milton ruser
Try data2$X<-factor(data2$X) By the way, avoid call data as "data", matrix as "matrix", vector as "vector". cheers milton On Wed, Mar 10, 2010 at 4:35 PM, clee wrote: > > If anyone can help with this, I would greatly appreciate it. > > When I subset a dataframe, and then create a table of on

[R] modify the levels of a variable

2010-03-10 Thread clee
If anyone can help with this, I would greatly appreciate it. When I subset a dataframe, and then create a table of on of the column variables, the levels of that variable are retained from the parent dataframe. Anyone know how to for example, say I have data like so: data: X Y a 2 b