[R] SPSS long variable names

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Oct 13 18:14:20 CEST 2009

Orvalho Augusto wrote:
> Sadlly exportation to csv or another format is not implemented yet:
> http://www.gnu.org/software/pspp/manual/html_node/Not-Implemented.html
> Caveman

That would not solve the problem anyway because you would not get labels 
and other variable attributes.


> On Tue, Oct 13, 2009 at 4:41 PM, joris meys <jorismeys at gmail.com> wrote:
>> Just for clarity : the csv format will solve your problem, as the
>> restrictions on the variable names will only depend on the program you
>> use to load them. I never experienced problems with variable names
>> using csv to switch datasets between SPlus, R, SAS and SPSS.
>> Cheers
>> Joris
>> On Tue, Oct 13, 2009 at 4:35 PM, joris meys <jorismeys at gmail.com> wrote:
>>> Sorry to be so blunt, but I cannot believe PSPP can't save a dataset
>>> as a .csv file for example. That should be the prefered format to
>>> transport a dataset to any other statistical package, including R. csv
>>> files are universal.
>>> Cheers
>>> Joris
>>> On Tue, Oct 13, 2009 at 3:30 PM, Orvalho Augusto <orvaquim at gmail.com> wrote:
>>>> Thanks for the answer.
>>>> Hmisc uses read.spss from the foreign package. And so it does not
>>>> solve my trouble.
>>>> I need to read the long names on the SPSS dataset.
>>>> Caveman
>>>> On Tue, Oct 13, 2009 at 3:01 PM, John Kane <jrkrideau at yahoo.ca> wrote:
>>>>> library(Hmisc) spss.get may do it but it's been some time since I used it.
>>>>> --- On Sat, 10/10/09, Orvalho Augusto <orvaquim at gmail.com> wrote:
>>>>>> From: Orvalho Augusto <orvaquim at gmail.com>
>>>>>> Subject: [R] SPSS long variable names
>>>>>> To: r-help at r-project.org
>>>>>> Received: Saturday, October 10, 2009, 12:14 PM
>>>>>> Hello guys I am new to this list and
>>>>>> for R too.
>>>>>> I am wondering if there is a patch for the SPSS reading
>>>>>> code on the
>>>>>> foreign package, in order to be able to read long variable
>>>>>> names.
>>>>>> Right now read.spss() just trunc the names to 8
>>>>>> characters.
>>>>>> Or if someone could help me on other way:
>>>>>> I have to process everyday a lot of SPSS Syntax Files and
>>>>>> Dat files
>>>>>> that come from one system that can only export data on
>>>>>> through that
>>>>>> way.
>>>>>> I use PSPP to generate the spss data file (sav) that I read
>>>>>> with R.
>>>>>> >From R I can export to MySQL, DBF and STATA to satisfy
>>>>>> the needs of
>>>>>> different guys here.
>>>>>> The problem is the limit of 8 characters long on variable
>>>>>> names.
>>>>>> Can someone help on that?
>>>>>> Caveman
>>>>>> ______________________________________________
>>>>>> 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.

Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

More information about the R-help mailing list