Learning R-SPSS integration package

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Learning R-SPSS integration package

Luca Meyer
Hello,

I am reading the SPSS-R Integration package.pdf I have found in the CD
accompaning the SPSS16 release and I am trying to apply some of the
examples. I have difficulties with the following code:

BEGIN PROGRAM R.
var1 <- c("Newspaper","Newspapers",0,"F1","scale")
var2 <- c("TV","Television",0,"F1","scale")
var3 <- c("Web","Internet",0,"F1","scale")
var4 <- c("Radio","Radio",5,"A5","nominal")
dict <- spssdictionary.CreateSPSSDictionary(var1,var2,var3,var4)
spssdictionary.SetDictionaryToSPSS("results",dict)
values <- c(0,1)
labels <- c("Local","National")
spssdictionary.SetVariableAttributes("results","TV",values,labels)
spssdictionary.EndDataStep()
END PROGRAM.

The lines not working - i.e. not assigning the right attributes are the
followings:

values <- c(0,1)
labels <- c("Local","National")
spssdictionary.SetVariableAttributes("results","TV",values,labels)

Can anyone assist me on this? Should I post to another forum (as for
instance to a R discussion list?)

Thanks,
Luca

PS: i am running SPSS 16.0.1 with the 16.0.1 R-SPSS plugin version

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.4/1227 - Release Date: 16/01/2008
1.40

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD