On Thu, Jul 28, 2011 at 8:26 AM, Griffith Rees
<[email protected]> wrote:
> I think this page quite succinctly describes this issue:
> http://www.statmethods.net/input/variablelables.html

It would be easy to add to data.table. You could also add support
outside of data.table by writing label.data.table and similar
functions. Actually using the labels for useful things is more
difficult. I often find it useful just to use more verbose variable
names that include spaces as follows:

> dt <- data.table(`My first column` = 1:3, `A character column` = 
> letters[1:3], check.names = FALSE)
> str(dt)
Classes 'data.table' and 'data.frame':  3 obs. of  2 variables:
 $ My first column   : int  1 2 3
 $ A character column: Factor w/ 3 levels "a","b","c": 1 2 3

That way, columns look better with automatic plotting and with lattice
or ggplot legends.

- Tom
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to