[R] SPSS import problem

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Mar 12 20:10:46 CET 2008


On Wed, 12 Mar 2008, K. Elo wrote:

> Hi again,
>
> many thanks for Your answers. So, if I understood Wei right:
>
> Zhao, Wei (Cancer Center) wrote (12.3.2008):
>> I had a similar problem when read one of my spss.sav with long
>> variable label. But when I read another spss.sav with short label the
>> same way, I don't have problem.
>> Seems like R only allows variable labels of lengths 1...255 as your
>> error message showed.
>
> Searching (in SPSS) all variable labels of length > 255 and coercing
> them to the length of 255 should solve the problem.
>
> @Brian, who wrote:
>> read.spss() is not targetted at such a recent version of SPSS, and
>> only allows variable labels of lengths 1...255.
>
> I can save the data in SPSS ver 7 -format, too. Is this version
> supported by the import function?

I don't know for sure: it was written ca 1998 for the PSPP project and I 
don't know for sure how the file format was found.

> However, the error message "error reading system-file header" gives the
> impression that the problem is somewhere else than in the overlength
> labels. Or have I understood something wrong?

It might be, which is why we need to see an example.  I suspected there is 
more to this that just changing the limit in the read.spss internals.

> Unfortunately, I cannot make the whole data file available. I could make
> a snapshot resulting in the same error - would that be helpful?

Yes, it would.

> Kind regards,
> Kimmo

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list