Displaying 1 result from an estimated 1 matches for "dimattr".
2009 Jul 08
3
Suggestion: Dimension-sensitive attributes
...ributes" in addition to 'dimnames'? These attributes would then be subsetted just like dimnames.
Something like this:
> x <- array(1:30, dim=c(2,3,5))
> dimnames(x) <- list(c("a", "b"), c("a1", "a2", "a3"), NULL);
> dimattr(x, "misc") <- list(1:2, list(x=1:5, y=letters[1:8], z=NA), letters[1:5]);
> y <- x[,1:2,2:3]
> str(dimnames(y))
List of 3
$ : chr [1:2] "a" "b"
$ : chr [1:2] "a1" "a2"
$ : NULL
> str(dimattr(x, "misc"))
List o...