[R] A matrix of lists?

R.E. Darnell R.E.Darnell at newcastle.ac.uk
Tue Nov 30 12:09:59 CET 1999


I tried to construct a matrix of lists e.g.

R> Matlist<-matrix(list(a1=c(1:4),b1=c(1:3),a2=c(1:9),b2=c(1:2)),nrow=2,ncol=2,byrow=F)
Error: Unimplemented feature in copyVector

V&R p52 talk about ragged arrays using a labelling factor. I am not
sure what this means.  Is it that the list indexing can be defined by
two factors (of length 4 in this example) that hold the row and column
indices? How would I reference a subset of list items then  
(Matlist[[Col==2]]  ?)  
Trying something like this gives me

R> Matlist[[Col==2]]
Error: attempt to select more than one element
 

My aim is to have a set of lists that I can refer to using matrix type
indexing  like Matlist[,2] or Matlist[,-1]. 

I appreciate any help

Ross Darnell
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list