[R] How to create a numeric data.frame

Aparna aparna.sampath26 at gmail.com
Mon Jun 13 12:06:40 CEST 2011


Hi All

I am new to R and  I am not sure of how this should be done. I have a matrix of 
985x100 values and the class is data.frame. 

A sample of my dataset looks like this (Since its a huge dataset and it would 
make the screen look more complex, I am pasting only the first few rows and 
columns. 

 V2           V3           V4           V5           V6
2   0.009953966  -0.01586103 -0.016227028  0.016774711 -0.021342598
3  -0.230181145  0.203303786 -0.685321843  0.147050709 -0.122269004
4  -0.552905273 -0.034039644 -0.511356309 -0.330524909 -0.239088566
5  -0.089739322 -0.082768643 -0.411209134 -0.301011664  1.560185991
6  -1.986059137 -0.252217616 -0.369044526 -0.585619405  0.545903757
7  -1.635875161  2.741310455 -0.058411313 -1.458825827  0.078480977
8   0.525846706 -1.134643662 -0.067014844 -1.431990219 -0.557057121
9  -0.913511821  0.688374777  0.376412044 -0.861746434  2.065507172
10 -1.538179621  0.814330376  1.639939042  -1.41478931  1.802738289
11  0.817957993 -0.426560507  2.773380242 -0.123291817  1.316883748


When I try to use this command to convert it to numeric, 

as.numeric(leu_cluster1): I get an error Error: (list) object cannot be coerced 
to type 'double'. I tried several functions and looked into other forums too, 
but could not find a solution. i am trying to change it to numeric data.frame 
and not to a matrix.


thanks in advance. :)



More information about the R-help mailing list