[R] fail to recover decimal value from data frame

Gonçalo Ferraz gferraz29 at gmail.com
Wed Sep 12 16:03:36 CEST 2007


Hi,
I have some decimal values stored in a data frame (myframe) and I  
need to place them in a matrix (mymatrix) using a for loop.
When I type:

 > myframe[i,10]

I get:

[1] 0.8714
434 Levels: 0 0.0134 0.1062 0.1182 0.1241 0.1322 0.1374 0.1429  
0.1507 ... psi1

But when I assign that value to the matrix with:

 > mymatrix[i,2]<-myframe[i,10]

The value that gets placed in the matrix is 286, and not 0.8714 as I  
wanted it to be. What is wrong?
The data frame does have several rows of character cells interspersed  
with "NA" and decimal values. It is not very simple I am just using  
it to store a large output worksheet from where I want to draw  
selected values.

Thanks for any help.

G.



More information about the R-help mailing list