[R] Reading SPSS .por files

Jose Iparraguirre D'Elia Jose at erini.ac.uk
Tue Jul 22 10:14:04 CEST 2008


Many thanks to you both,
José

-----Original Message-----
From: Peter Dalgaard [mailto:p.dalgaard at biostat.ku.dk] 
Sent: 18 July 2008 18:19
To: Jose Iparraguirre D'Elia
Cc: Prof Brian Ripley; r-help at r-project.org
Subject: Re: [R] Reading SPSS .por files

Jose Iparraguirre D'Elia wrote:
> [snip]
>   
>> Thanks Brian,
>>
>> The error message reads as follows:
>>
>> Error in read.spss("G:/Jose/Life and Times Survey/LT 2007/nilt07w1.por") :
>>  error reading portable-file dictionary
>>     
>
> So it looks like it is not a portable file, or at least one that read.spss 
> knows about
Actually, no. I noticed that it had "8bit ascii" characters inside so on 
a hunch I sent it through iconv and got a different error message

 > read.spss("xxx.por", use.value.labels=FALSE)
Error in read.spss("xxx.por", use.value.labels = FALSE) :
  file 'xxx.por' is not in any supported SPSS format

So read.spss() recognizes the format of the original file alright, it's 
just that something in the file does not match the format that 
read.spss() expects. It reads at least one .por file, namely the one 
that ships with the source for the foreign package in the tests 
directory (pbc.por). It is not unlikely that it can be confused by 
character set encodings and CR/LF inside value labels, though.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list