[R] How to create a numeric data.frame

Aparna aparna.sampath26 at gmail.com
Mon Jun 13 18:47:25 CEST 2011


Hi Joshua

While looking at the data, all the values seem to be in numeric. As i mentioned, 
the dataset is already in data.frame. 

As suggested, I used str(mydata) and got the following result:


str(leu_cluster1)
'data.frame':   984 obs. of  100 variables:
 $ V2  : Factor w/ 986 levels "-0.00257361",..: 543 116 252 54 520 ...
 $ V3  : Factor w/ 986 levels "-0.000790437",..: 7 666 14 32 105 ...
 $ V4  : Factor w/ 986 levels "-0.0023231","-0.004207663",..: 6 353 267 208 
187... 
 $ V5  : Factor w/ 986 levels "-0.006466083",..: 585 627 146 131 263 ...
 $ V6  : Factor w/ 986 levels "-0.002119173",..: 11 56 111 898 780...
 
 
The columns are not numeric, which I understood from this. 


There is a function called data_check as part of Clustercons package 
I am using for this project. This helps me check whether the input data is 
numeric or not. Using this I could tell that my data is not numeric 
and that is why I was trying to convert it to numeric data.
 
This forum is of great help since I am able to learn more and 
thanks for making this forum so helpful to people like us who are new to R.

Aparna



More information about the R-help mailing list