Displaying 1 result from an estimated 1 matches for "diarydata".
Did you mean:
binarydata
2006 Jul 12
4
Keep value lables with data frame manipulation
.... The result is stored in a new data.frame, however, in
this new data.frame the value labels are lost.
Example of what I do in code:
# read raw data from spss
rawdata <- read.spss("./data/T50937.SAV",
use.value.labels=FALSE,to.data.frame=TRUE)
# select the observations that we need
diarydata <- rawdata[rawdata$D22==2 | rawdata$D22==3 | rawdata$D22==17 |
rawdata$D22==18 | rawdata$D22==20 | rawdata$D22==22 |
rawdata$D22==24 | rawdata$D22==33,]
The result is that rawdata$D22 has value labels and that diarydata$D22
is numeric without value labels.
Question: How can I prevent this...