How can you define the responses for survey items in R?
For instance, this is SPSS data imported, but it strips the definitions when you translate them.
data$q27
prints the definitions, but
as.numeric(data$q27)
prunes them
How can I redefine them?
To set the attributes directly, you can do:
attr(data$q27, "value.labels") <- c("No" = 2, "Yes" = 1)