Created attachment 1645 [details]
SPSS file with 1 record to demonstrate extra columns problem
I see there was BUG 15152 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15152) that says the long SPSS strings cause extra variables to appear in the R data frame. I fear the problem I see today with read.spss. So I'm asking for advice.
A Macintosh-using student showed a dataset in SPSS, then tested same with read.spss. He found the R data frame has about 100 extra empty columns.
I see same in Linux with R 3.1.1
> dat <- read.spss("KK_SPSS.sav", to.data.frame = TRUE).
re-encoding from latin1
1: In read.spss("KK_SPSS.sav") :
KK_SPSS.sav: Unrecognized record type 7, subtype 14 encountered in system file
2: In read.spss("KK_SPSS.sav") :
KK_SPSS.sav: Unrecognized record type 7, subtype 17 encountered in system file
3: In read.spss("KK_SPSS.sav") :
KK_SPSS.sav: Unrecognized record type 7, subtype 18 encountered in system file
If you try that, at the left side of the data frame, there is a variable called "NAME_1_TEXT" and then there are empty columns "NAME_7" "NAME_8" "NAME_9" "NAME_A" "NAME_B" "NAME_C" "NAME_D"
However, current pspp can open the file and there are none of those extra columns apparent.
Can you advise on work arounds? Should the SPSS user do something differently? Or should the R be more careful somehow?