[R] How to avoid rounding of matrix elements?
Ulas Karaoz
ulask at bu.edu
Fri Jan 7 00:57:03 CET 2005
Hi all R-users,
If I have a matrix with numeric elements as follows, the values are
rounded when I try to refer to a specifici element using [], the value
is rounded.
The same thing happens if the matrix is read from a file, the values are
stored to the correct precision but then when I try to refer to a
specific element (such as using [], it is rounded.
How do I avoid this rounding?
>mdat<-matrix(c(0.0187972950,0.4446208550,1.0000000000,0.0003204380,0.0105002420,1.1087556380,0.0742164230,0.0362898240),
nrow = 2, ncol=4)
> mdat
[,1] [,2] [,3] [,4]
[1,] 0.01879729 1.000000000 0.01050024 0.07421642
[2,] 0.44462085 0.000320438 1.10875564 0.03628982
Thanks.
More information about the R-help
mailing list