Hi,

I would like to store some text and decimal values in the following  
form:

name    dec.val dec.val ...     dec.val
name    dec.val dec.val ...     dec.val
...
name    dec. val        dec.val ...     dec.val

To do so, I created a matrix of the necessary size (x row per y cols)  
with the command

matrixname <- matrix(0,x,y)

and proceeded to fill in the matrix with information drawn from a  
data frame.

The problem is that the resulting matrix only has integers at the end  
of the filling process.

When I ask:
class(dataframename[i,j])
The answer is "factor"

What is the best way of solving the problem. Should I use a data  
structure other than a matrix? Or should I make the elements be a  
different class (other than "factor") when I assign them to the matrix?

Thanks for any help!

G.






        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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