Re: [R] How to call a value labels attribute?

From: Martin Maechler <>
Date: Sat 03 Jun 2006 - 22:12:12 EST

>>>>> "Heinz" == Heinz Tuechler <>
>>>>> on Tue, 23 May 2006 01:17:21 +0100 writes:

    Heinz> Dear All, after searching on CRAN I got the
    Heinz> impression that there is no standard way in R to
    Heinz> label values of a numerical variable.  

Hmm, there's names(.) and "names(.) <- .." Why are those not sufficient?

x <- 1:3
names(x) <- c("apple", "banana", NA)

    Heinz> Since this
    Heinz> would be useful for me I intend to create such an
    Heinz> attribute, at the moment for my personal use.  Still
    Heinz> I would like to choose a name which does not conflict
    Heinz> with names of commonly used attributes.

    Heinz> Would value.labels or vallabs create conflicts?

    Heinz> The attribute should be structured as data.frame with
    Heinz> two columns, levels (numeric) and labels
    Heinz> (character). These could then also be used to
    Heinz> transform from numeric to factor. If the attribute is
    Heinz> copied to the factor variable it could also serve to
    Heinz> retransform the factor to the original numerical
    Heinz> variable.

    Heinz> Comments? Ideas?

    Heinz> Thanks

    Heinz> Heinz Tüchler

    Heinz> ______________________________________________
    Heinz> mailing list
    Heinz> PLEASE
    Heinz> do read the posting guide!
    Heinz> mailing list PLEASE do read the posting guide! Received on Sat Jun 03 22:21:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 04 Jun 2006 - 22:10:28 EST.

Mailing list information is available at Please read the posting guide before posting to the list.