On Jul 30, 2009, at 11:50 PM, Steve Jaffe wrote:


I can do this by writing (and reading) the file according to some format of my own devising, but I'm wondering if there is a built-in way to write and
then restore a matrix with not only the dimnames (which
write.table/read.table can preserve) but also the names(dimnames)?

Example:
M <- matrix(1:4, 2, 2)
dimnames(M) <- list(xdim=c("a", "b"), ydim=c("u", "v"))
M
   ydim
xdim u v
  a 1 3
  b 2 4

There are two such matched combinations for saving R objects complete with attributes:

dput/dget # will be more readable with a text editor than the next option

save/load  # not very readable



David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
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.

Reply via email to