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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to