|
I should apologize, I should have sostituted .SetVariableAttributes with
.SetValueLabel. The following works: 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.SetValueLabel("results","TV",values,labels) spssdictionary.EndDataStep() END PROGRAM. Nevertheless, I would much appreciate suggestion on forum, books and other material you might be using to learn R-SPSS integration. Thanks Luca _____ Da: Luca Meyer [mailto:[hidden email]] Inviato: mercoledì 16 gennaio 2008 12.25 A: '[hidden email]' Oggetto: Learning R-SPSS integration package 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 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 |
| Free forum by Nabble | Edit this page |
