One aspect of S that bothers me (this applies to Version 5 for Unix, as well
as older versions that I still sometimes run) is that when printing matrices
or arrays there is no easy way to have labels for the dimensions printed
along with the labels for the levels of each dimension. Because it is
possible to name the elements of the dimnames list, the data structures
necessary to support this type of labeling exist. So, for example, when
printing the following simple matrix (whose structure below has been dumped
with dput())
matrix(c(1, 2, 3, 4) , nrow = 2, ncol = 2
dimnames = list("Fact1" = c("L1", "L2") , "Fact2" = c("L1", "L2") ) )
I would prefer output that looks like
Fact2
L1 L2
Fact1 L1 1 3
L2 2 4
rather than the current default which is
L1 L2
L1 1 3
L2 2 4
This approach is, I believe, upward compatible because most of the time the
dimnames components are not named and, in this case, the current default
output would presumably be produced.
Has anyone already come up with a way to do this?
Ted Wright
|