How to read a .sav SPSS file in in R?

13,278

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

 library(foreign)
 read.spss('persona.sav', reencode='utf-8')
Share:
13,278
Felipe Hoffa
Author by

Felipe Hoffa

Data Cloud Advocate, Snowflake https://medium.com/@hoffa/

Updated on June 04, 2022

Comments

  • Felipe Hoffa
    Felipe Hoffa almost 2 years

    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