문제

I've tried read.spps(), but I get an encoding error:

library(foreign)
read.spss('persona.sav')
#>re-encoding from CP1252

Error in iconv(names(rval), cp, "") : unsupported conversion from 'CP1252' to '' In addition: Warning message: In read.spss("persona.sav") : persona.sav: Unrecognized record type 7, subtype 18 encountered in system file

도움이 되었습니까?

해결책

Try re-encoding it as a utf-8 file:

 library(foreign)
 read.spss('persona.sav', reencode='utf-8')

다른 팁

You can try adding 'to.data.frame = TRUE' into read.spss()

For instance:

df <- read.spss("data.sav", to.data.frame = TRUE)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top