Lakuca
Lakuca

Reputation: 31

Load R package in SPSS

I have just started working with the integration of R into SPSS and I have problems with loading some R packages in SPSS. I can load e.g. library(foreign) or library(graphics) but it does not work for library(xlsReadWrite) or library(FactoMineR). I have installed these packages into R already and I can load them in R also.

When using this syntax in SPSS:

BEGIN PROGRAM R.

library(xlsReadWrite)

END PROGRAM.

I am getting error Error in library(xlsReadWrite) : there is no package called 'xlsReadWrite'.

Many thanks,

Lakuca

Upvotes: 3

Views: 4087

Answers (2)

IRTFM
IRTFM

Reputation: 263311

If you want an earlier version of xlsReadWrite you can get the sources at the Archive page

Upvotes: 1

JKP
JKP

Reputation: 5417

In order to build the R plugin/Essentials package, SPSS Statistics has to link with a specific version of R, although you can have others installed as well. SPSS typically releases annually, and the most current R version consistent with the SPSS Statistics release date (which means it has to be available on multiple platforms and stable several months in advance) is used. Even if it isn't the very latest version of R, it is rare for packages not to work in older R versions.

Besides the Essentials package, there are a number of already integrated R packages - SPSS dialog boxes, syntax, and output provided by SPSS or contributed by users - that can be downloaded free from the SPSS Community at www.ibm.com/developerworks/spssdevcentral The R Essentials are currently hosted at SPSS Developer Central at www.spss.com/devcentral.

Regards, Jon Peck

Upvotes: 3

Related Questions