A wish somehow related to my wish 8658: Package foreign allows to import
categorical data from SPSS (and possibly other software) using the original
codes, which are often useful for data manipulation, since one can use already
available lists of codes from others who don't use R etc. The original value
labels are preserved as an attribute of the variables. It would be very nice if
these value labels instead of the codes could be displayed in tables. The code
at the end of this note illustrates what I mean; currently I can only achieve a
conveniently annotated table by generating a factor from each variable I want to
tabulate with a lengthy command.
My wish: being able to generate the last table in the example output by a
statement like 'table(data1$time)' or 'table(data1$time, use.value.labels=T)' or
'table(as.factor(data1$time))' would do the job, if 'as.factor()' would use
value labels (like in
data1$ftime <- factor(data1$time,levels=attr(data1$time, "value.labels"),
), whenever they are present. This might also help in obtaining more meaningful
output e.g. from regression procedures with such data.
Hoping this wish will make it to the list of wishes fulfilled some day.