yongkook Kwon wrote:
Hi~ helpers.
I was surprised by R data type.
I use to data type like table.
I don't know R allow several data type such as list, number, matrix in the
same matrix.
I want to use plsr in pls package to anlaysis data.
So, I read R help and example of plsr.
that example show me that data as yarn has three colname as NIR, density and
train.
the NIR was 268(No. of col) X 71(No. of row) matrix, but density was just
71 list
yarn[1] indicate NIR, and yarn[2] indicate density
so I just tested like that TEST=c(matrix , list)
But It was wrong.
how can I make like matrix?
Of cource, the python, perl or JAVA could like that.
just simplely but I don't know in R.
please tell me about that.
Hi yongkook,
The easiest way is:
yarn.mat<-as.matrix(yarn)
yarn.mat will now contain the values but in a matrix format.
Jim
______________________________________________
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.