Skip to content
Prev 66921 / 398513 Next

factor to numeric in data.frame

On Sat, 2 Apr 2005, Heinz Tuechler wrote:

            
Yes: unclass is applied to a column and not the data frame.

newdf <- df
newdf[1:10] <- lapply(newdf[1:10], unclass)

BTW, please read the posting guide, and do not say `does not work' when it 
patently does work as documented.
Yes, it does work.  What do you think [[1:2]] does?   Please RTFM.
That also works: unclassing a data frame gives a list.