[R] Factor to variable

bjlwilkinson at gmail.com bjlwilkinson at gmail.com
Sat Jun 5 14:10:37 CEST 2010


I have a data frame called z that includes four columns:

Col1 Col2 Col3 Col4
Text1 Text2 X0.1 5
Text1 Text2 X0.2 10
Text1 Text2 X0.3 15
Text1 Text3 X0.1 5
Text1 Text3 X0.2 10
Text1 Text3 X0.3 15

I am trying to convert the 3rd column to the numeric value excluding the X so that I can produce a lattice plot. 

I have tried a number of approaches including z$Col3[z$Col3=="X0.1"]="0.1" as a first step but get an error: invalid factor level NAs generated. 


Sent from my BlackBerry® wireless device


More information about the R-help mailing list