I think this is definitely out of the scope of data.table.<br><br><div class="gmail_quote">On 28 July 2011 13:43, Tom Short <span dir="ltr"><<a href="mailto:tshort.rlists@gmail.com">tshort.rlists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Thu, Jul 28, 2011 at 8:26 AM, Griffith Rees<br>
<<a href="mailto:griffith.rees@sociology.ox.ac.uk">griffith.rees@sociology.ox.ac.uk</a>> wrote:<br>
> I think this page quite succinctly describes this issue:<br>
> <a href="http://www.statmethods.net/input/variablelables.html" target="_blank">http://www.statmethods.net/input/variablelables.html</a><br>
<br>
</div>It would be easy to add to data.table. You could also add support<br>
outside of data.table by writing label.data.table and similar<br>
functions. Actually using the labels for useful things is more<br>
difficult. I often find it useful just to use more verbose variable<br>
names that include spaces as follows:<br>
<br>
> dt <- data.table(`My first column` = 1:3, `A character column` = letters[1:3], check.names = FALSE)<br>
> str(dt)<br>
Classes 'data.table' and 'data.frame': 3 obs. of 2 variables:<br>
$ My first column : int 1 2 3<br>
$ A character column: Factor w/ 3 levels "a","b","c": 1 2 3<br>
<br>
That way, columns look better with automatic plotting and with lattice<br>
or ggplot legends.<br>
<font color="#888888"><br>
- Tom<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a><br>
</div></div></blockquote></div><br>