[R] variable names from SPSS data base

Thomas Lumley tlumley at u.washington.edu
Tue May 9 19:17:04 CEST 2006


On Tue, 9 May 2006, SUBIRANA CACHINERO, ISAAC wrote:

> Hi R-users,
>
> When I import a data base from SPSS with some variable with a name of
> more than 8 characters (which is possible in version 12 or later of SPSS
> software) I find that the name of these variables have been truncated to
> 8 characters. I used the 'read.spss' function from the 'foreign'
> package.

They have not been truncated by R. R reads the short variable names that 
SPSS stores

There is no code in R to read the long variable names, or AFAIK any plans 
to write any -- it isn't a high priority for the people who wrote 
read.spss.  The basic C code needed is in the GNU PSPP program, but it 
would take some effort to extract it and put it in the foreign package.  I 
understand that SPSS also makes code available for reading SPSS files now, 
and that could be used instead.  We would welcome well-tested patches to 
read.spss, but I don't think it will happen any other way.


 	-thomas




More information about the R-help mailing list