Re: [R] Reading SPSS .por files

From: Jose Iparraguirre D'Elia <>
Date: Tue, 22 Jul 2008 09:14:04 +0100

Many thanks to you both,

-----Original Message-----
From: Peter Dalgaard [] Sent: 18 July 2008 18:19
To: Jose Iparraguirre D'Elia
Cc: Prof Brian Ripley; 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
~~~~~~~~~~ - (              FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 22 Jul 2008 - 09:00:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Jul 2008 - 09:32:03 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive