[R] [Related Topic] need help on read.spss

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Oct 14 12:00:55 CEST 2011


On 13.10.2011 18:28, Matt Shotwell wrote:
> Would it be worthwhile to update the read.spss implementation using the
> more recent discoveries from the PSPP group?

If there are important features, I think so. Getting code into foreign 
is not too trivial. Smaller changes are more likely to be accepted than 
a re-implementation which would need really careful and extensive tests.
Note also this won't resolve the underlying problem I described in my 
last message.

 > I don't mean to copy their code;

Iff the code is reasonable, why not talk to the PSPP people, take the 
code and adapt it, given it is GPL'ed.


> but to use the ideas in their code. Is anyone working on this? I
> wouldn't want the effort to be duplicated.

Not that I know, at least.

Best,
Uwe Ligges



>
> On Thu, 2011-10-13 at 16:22 +0200, Uwe Ligges wrote:
>>
>> On 11.10.2011 12:07, Smart Guy wrote:
>>> Hi,
>>>         I have one doubt about one of the parameter of 'read.spss()' from
>>> 'foreign' package.
>>> Here is the syntax :-
>>>
>>> read.spss ( file,
>>>       use.value.labels = TRUE,
>>>       to.data.frame = FALSE,
>>>       max.value.labels = Inf,
>>>       trim.factor.names = FALSE,
>>>       trim_values = TRUE,
>>>       reencode = NA,
>>>       use.missings = to.data.frame )
>>>
>>>
>>> In above syntax when I pass *'to.data.frame= FALSE*' it gives me missing
>>> values from SPSS file (that I try to read using read.spss() ). But when I
>>> pass '*to.data.frame = TRUE*' then its not giving me missing values. And
>>> need to get missing values.
>>>
>>> According to read.spss() documentation
>>>
>>> *to.data.frame :  return a data frame?*
>>>
>>> I am curious to know, if we pass *'to.data.frame = TRUE*' , is it going to
>>> cause some issue or effect something? I didn't understand the read.spss()
>>> documentation correctly.
>>> Please explain.
>>>
>>> Thanks in Advance
>>>
>>
>> An R data.frame cannot represent different kinds of missing values,
>> since R just has "NA". Therefore, there are two way to import data:
>>
>> to.data.frame=FALSE  will read all the information, but into a format
>> you will likely have to postprocess to make it conveniently usable.
>>
>> to.data.frame=TRUE   will import into a data.frame, but that cannot
>> represent all the nuances known from the SPSS representation.
>>
>> Uwe Ligges
>>
>> ______________________________________________
>> 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.
>
>



More information about the R-help mailing list