I wrote a function that reads data from a file and manipulates it to build and return a matrix with a million rows and three columns. I also need to return some metadata: these are about a half-dozen single numbers or short character strings, plus one numeric vector of length 5,000. I've been including the metadata as attributes to the matrix, but I find that attributes can be lost upon some later manipulations of the matrix. My question is, what are the pros and cons of having the function return a list instead, one that includes the matrix and the metadata, compared to how I'm doing it now? I'm interested in storage and retrieval efficiency, and anything else that may be relevant. What are your opinions? Thanks.
Confidentiality Notice: This e-mail message, including a...{{dropped:10}} ______________________________________________ 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.