Hi, I'm trying to import categorical data from SPSS to R using the script: xxx <-spss.get("xxx.por", use.value.labels=TRUE) but unfortunately am getting an error message 'error reading portable-file dictionary'. I have successfully imported data in the past. What could be the problem with this data? Thanks Simo ____________________________________________________________________________________ Be a better friend, newshound, and [[alternative HTML version deleted]]
Simo Vundla wrote:> Hi, > I'm trying to import categorical data from SPSS to R using the script: > xxx <-spss.get("xxx.por", use.value.labels=TRUE) but unfortunately am getting an error message 'error reading portable-file dictionary'. > > I have successfully imported data in the past. > > What could be the problem with this data? > > Thanks > > SimoFirst of all, follow the posting guide. Second, state which package you are using (in this case Hmisc). spss.get in Hmisc uses read.spss in the foreign package. See the documentation of read.spss for more details. You will find there: 'read.spss' reads a file stored by the SPSS 'save' and 'export' commands and returns a list. read.spss does not claim to be able to read SPSS .por files. Frank -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
Hi, you might try to use the foreign-package, which contains the function read.spss. This works fine most of the time, For a description of its usage, see the help-files or my own website: http://www.rensenieuwenhuis.nl/r-project/manual/basics/getting-data- into-r-2/ Remember, you'll need to install the foreign-package first. Hope this helps, Rense Nieuwenhuis On Jan 6, 2008, at 12:46 , Simo Vundla wrote:> Hi, > I'm trying to import categorical data from SPSS to R using the script: > xxx <-spss.get("xxx.por", use.value.labels=TRUE) but unfortunately > am getting an error message 'error reading portable-file dictionary'. > > I have successfully imported data in the past. > > What could be the problem with this data? > > Thanks > > Simo > > > > > > > > > ______________________________________________________________________ > ______________ > Be a better friend, newshound, and > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >
At 11:46 06/01/2008, Simo Vundla wrote:>Hi, >I'm trying to import categorical data from SPSS to R using the script: >xxx <-spss.get("xxx.por", use.value.labels=TRUE) but unfortunately >am getting an error message 'error reading portable-file dictionary'. > >I have successfully imported data in the past.In my experience there is quite a high failure rate with files which people send me and which they claim to be in SPSS save format or SPSS portable format. If they have a reasonably recent version of SPSS then ask them to save it in Stata format which at least in my experience is a more robust process.>What could be the problem with this data? > >Thanks > >Simo > > > > > > > > >____________________________________________________________________________________ >Be a better friend, newshound, and > > > [[alternative HTML version deleted]]Michael Dewey http://www.aghmed.fsnet.co.uk