hits=-2.6 tests=BAYES_00
X-USF-Spam-Flag: NO

On Thu, 2008-02-07 at 19:32 +0900, Tribo Laboy wrote:
> Hello,
> 
> I was wondering if there was an easy way to put information about the
> measurement units used for each column of a data frame ...
> 
> Thanks for any pointers,
> 
> TL

You could add attributes:

dummy <- data.frame(x = rnorm(10), y = rbeta(10, 2, 5), z = rlnorm(10))
dummy

attr(dummy, "units") <- c("m s-2", "Kg", "m")
dummy
attributes(dummy)

G
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
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