title: Read SPSS file into R
body: <p>I am trying to learn R and want to bring in an SPSS file, which I can open in SPSS.  </p>
  
  <p>I have tried using <code>read.spss</code> from <code>foreign</code> and <code>spss.get</code> from <code>Hmisc</code>.  Both error messages are the same. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>## install.packages("Hmisc")
  library(foreign)
  
  ## change the working directory
  getwd()
  setwd('C:/Documents and Settings/BTIBERT/Desktop/')
  
  ## load in the file
  ## ?read.spss
  asq &lt;- read.spss('ASQ2010.sav', to.data.frame=T)
  </code></pre>
  
  <p>And the resulting error:</p>
  
  <blockquote>
    <p>Error in read.spss("ASQ2010.sav", to.data.frame = T) :    error
    reading system-file header In addition: Warning message: In
    read.spss("ASQ2010.sav", to.data.frame = T) :   ASQ2010.sav: position
    0: character `\000' (</p>
  </blockquote>
  
  <p>Also, I tried saving out the SPSS file as a SPSS 7 .sav file (was previously using SPSS 18).</p>
  
  <blockquote>
    <p>Warning messages: 1: In read.spss("ASQ2010_test.sav", to.data.frame =
    T) :   ASQ2010_test.sav: Unrecognized record type 7, subtype 14
    encountered in system file 2: In read.spss("ASQ2010_test.sav",
    to.data.frame = T) :   ASQ2010_test.sav: Unrecognized record type 7,
    subtype 18 encountered in system file</p>
  </blockquote>