[R] Dataframe manipulation

Antje niederlein-rstat at yahoo.de
Tue Dec 4 11:46:31 CET 2007


Hello,

can anybody help me with this problem?
I have a dataframe, which contains its values as factors though I have numbers 
but it was read as factors with "scan". Now I would like to convert these 
columns (multiple) to a numeric format.


# this example creates a similar situation

testdata <- as.factor(c("1.1",NA,"2.3","5.5"))
testdata2 <- as.factor(c("1.7","4.3","8.5",10.0))

df <- data.frame(testdata, testdata2)

what do I have to do to get the same datafram but with numeric values???

Antje



More information about the R-help mailing list