[Rd] several bugs (PR#918) lists and matrices

Rich Heiberger rmh@surfer.sbm.temple.edu
Mon, 23 Apr 2001 13:57:32 -0400 (EDT)


## Thomas rightly points out that list() is not the best structure for
## homogeneous data.  My example was the simplest that generated the
## error of a matrix structure that that doesn't work.  The application
## that this is simplified from needs lists because the data isn't
## homogeneous.  I am attempting to write a missing value class, where
## each item is a list.  In the simplest instance, if the datum is missing
## then the attribute contains the reason.
## 
## Both of the 'bugs'/'unimplemented features'
## 3. a <- matrix(list(1,2,3,4,5,6), 2, 3)
## 6. bug in "[" for lists
## show up in this example.  Thus

x <- list(1,2,3,4,5,6)
dim(x) <- c(2,3)
x[[2,3]] <- NA
attr(x[[2,3]],"mv") <- "absent"
x
for(i in x) print(i)
x[2,]
x[1,1]
x[2,3]

Rich
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._