Re: [R] Reading SPSS .por files

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


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

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive