[R] Converting Data Types

Edward Wijaya ewijaya at gmail.com
Wed May 21 04:16:36 CEST 2008


Hi,

How can I convert the matrices to list.

For example I have this snippet:

samples<-mymatrix[1,]
print(samples)

which prints:

     V1   V2    V3    V4    V5    V6
1 103.9 88.5 242.9 206.6 175.7 164.4


How can I convert the object "samples" such that it prints:
[1] 103.9 88.5 242.9 206.6 175.7 164.4

The reason I ask this because I can't use the former
"samples" object with this function:

llgm <- dgamma(samples, scale=1, shape=2, log = TRUE)

which gives this error:
e 1374Error in dgamma(x, shape, scale, log) :
  Non-numeric argument to mathematical function

Regards,
Edward



More information about the R-help mailing list