SPSS Statistics

 View Only

R + SPSS: Installing R Essentials from GitHub

By Archive User posted Mon March 21, 2016 04:35 PM

  
Last week, we released the new versions of SPSS Statistics (version 24) and SPSS Modeler (version 18). With the new product release we also have a new version of R Essentials available for both products. R has been integrated with SPSS Statistics since version 19 and Modeler since version 16. This integration allows for the creation of extensions, which are custom dialogs that allow you to use a GUI to execute R code in Statistics or Modeler. In the releases this week, a new feature for both products is the ability to download and install extensions from within the product. I am happy to announce that R Essentials can now be downloaded directly from GitHub.



Click here to find your version of R Essentials for SPSS Statistics



Click here to find your version of R Essentials for SPSS Modeler




Now I will walk through the installation of R Essentials for SPSS Modeler 18 and SPSS Statistics 24.


Install Guide for SPSS Modeler v18:



Previously, I wrote this blog post, which gives details on installing R Essentials in SPSS Modeler. I've included steps below for installing R Essentials for version 18 of Modeler with a couple extra tips.




  1. Install the correct version of R. For Modeler version 18 you will need to have R version 3.2.x installed on your machine. I downloaded this version here.

  2. Download and run R essentials from the Modeler R Essentials GitHub repository.

  3. When installing R Essentials, there are two file paths you will need to validate:


    • First, you need to indicate your R installation folder. My installer defaulted to R-3.2.1 but I have R-3.2.2 installed, so I needed to change it. If you try using an older version of R you will get an error message (I tried).
      install1

    • Next, you need to pick the right bin folder for your installation. This will be different based on where you installed Modeler. The installer defaults to the "ModelerServer" directory, but if you are not using Modeler Server this needs to be changed to the "Modeler" directory. The screen shot below shows the path that I used that was successful.
      install2

    • If everything was successful you should see this screen:

      install-confirm


  4. Now we have R installed and R Essentials installed. To do a quick test, let's open up Modeler 18


    • Add a User input node to the canvas and type something like 'a' into the Field and a number '1' in Values. This is dummy data just so we can run quick R code, if you already have a Source node on your canvas you can use that

    • From the Record Ops palette, add a R Transform node and type the following:
      print('hello modeler!')


      Not too exciting, but enough for now.

    • Now right click on this node and select preview. This will show a table of your input data, but what we care about is the Console Output in the R Transform node. It should look like this:

      test




If you produced the same output as shown in the screenshot then you have successfully installed R Essentials for Modeler!




Install Guide for SPSS Statistics v24:



  1. Install the correct version of R. For Statistics version 24 you will need to have R version 3.2.x installed on your machine. I downloaded this version here.

  2. Download and run R essentials from the Statistics R Essentials GitHub repository.

  3. When installing R Essentials, there are two file paths you will need to validate:


    • First, you need to indicate your R 3.2.x installation folder. This will look slightly different than the Modeler screenshot above but is the same step.

    • Next, you need to pick the installation folder for your Statistics version 24. I used the default install path so I did not have to change anything here. If you changed your install directory you will need to update this.

    • Next, you just need to confirm both directories you selected were correct and click Install.


  4. Now we have R installed and R Essentials installed. To do a quick test, let's open up Statistics 24


    • Open SPSS Statistics and create a new Syntax Editor by clicking File > New > Syntax

    • Let's type in some basic syntax for starting an R program and printing a statement


      BEGIN PROGRAM R

      print('Hello Statistics')

      END PROGRAM



    • Now highlight this code block or click the 'BEGIN PROGRAM' on the left pane of the Syntax editor and click the green 'Run Selection' button at the top of the screen. This will create a new Output window displaying your code and the R output:

      StatsTest




You now have R Essentials installed for version 24 of SPSS Statistics!



If using version 24 of SPSS Statistics or version 18 of Modeler - go to Extensions > Extension Hub to find & install extensions that will help make your work easier. If you are on an older version, visit the Predictive Analytics Gallery on GitHub to find extensions.






#Programmability
#R
#SPSS
#SPSSModeler
#SPSSStatistics
29 comments
533 views

Permalink

Comments

Tue October 16, 2018 08:06 PM

Thank you for the great explanation. I ran into this issue. After downloading the 64-bit version of R 3.2.0 and downloading R-essentials for Windows with the correct file paths. I tried running the program and got:
Error 6887:
External program failed during intialization.
Execution of this command stops
The SPSS package could not be loaded. Please make sure Essentials for R has been successfully installed.

Does anyone know how I should go about fixing this?

Tue October 16, 2018 04:12 PM

I am trying to install R-essentials for SPSS Stat V24 on a Windows 10 computer. I downloaded R 3.2.0 and R-essentials and the installation process works perfectly. However, when I try to run the R test program:

BEGIN PROGRAM R
print('Hello Statistics')
END PROGRAM

I get the following error message:

>Error # 6887. Command name: BEGIN PROGRAM
>External program failed during initialization.
>Execution of this command stops.
The spss package could not be loaded. Please make sure that Essentials for R has been successfully installed.

Any thoughts on how I can work this up?

Wed January 24, 2018 05:40 PM

Never mind. That was exactly it .... a little more heap size and it runs through. I suspect it is machine/architecture dependent.

Wed January 24, 2018 05:23 PM

Statistics V24 + R 3.2.5 on Linux:

The installation process freezes at 84% -- "Execute Script/Batch file: Install R packages".

Any leads on what might be the cause? In the past IBM's installers for Linux had improper JRE memory settings that led to similar problems. Unfortunately, I lost track of my notes and would like to avoid a lengthy troubleshooting process.

Thu December 14, 2017 03:35 PM

For Mac users, these are the folder paths for step 3:

-R Installation Folder Path:
Macintosh HD/Library/Frameworks/R.framework/Versions/3.2/Resources

-SPSS Installation Folder Path:
MacintoshHD/Applications/IBM/SPSS/Modeler/18/SPSSModeler/Contents/ext/bin

Sat September 30, 2017 04:29 PM

Hey, Ornelas! I am having the same issue for SPSS 22 while installing OPTMATCH. Please guide me, how did you manage to install it successfully? Thanks in advance.

Sun September 03, 2017 11:41 PM

I have Modeler v18.1 installed, along with R v3.4.1 on Mac. I tried installing "Essentials for R" several times but the R nodes do not show up in Modeler. I tried uninstalling R, and installing older versions of R as well, but no luck. Any help would be appreciated.

Tue June 20, 2017 02:42 AM

Modeler 18 only works with R 3.2. However, Modeler 18.1 just released can run with any verison of R but only R 3.3 is officially tested and supported.

Thu June 15, 2017 06:51 PM

Can Modeler 18 work with R 3.4 if yes how do I make the R essentials package work for it. Or is there a separate R essentials package available for R 3.4 and SPSS modeler 18 version.

Wed May 17, 2017 03:11 PM

Same problem with me. Can anyone please advise on this? I tried several times with different recommended versions but still facing problem.

Wed May 17, 2017 03:09 PM

Sam problem with me. Can anyone suggest on this error?

Sun February 19, 2017 05:35 PM

Manged to install all V22 related software. Will try V24 at some point later.

Sat February 18, 2017 05:16 PM

Not directly related. But I have SPSS V22 installed all the respective components: R, R essentials to run PSM. However, once I execute the addition PSM I get an error where it says it could not install optmach. I have tried to install the optmatch package but I get an error where R cannot create the library. Since the upgrade V24 is going to be ready soon, I thought about waiting and removing V22 and R related software, but actually wonder if I would still have the same problem.
I sure would like to know if anyone experienced my problem and a possible solution. Tried to create the library and still had the problem. I may add that I am new to R so still learning the its commands.
Thanks

Tue January 10, 2017 06:03 PM

Are there R essentials for Mac downloads on Github for SPSS v. 20 (I can only see downloads for versions 21 and up)? Thanks for your help!

Wed December 28, 2016 11:05 AM

I have been able to solve this problem by using R 3.2.1

Tue December 27, 2016 08:25 PM

I am using R 3.3.2

Tue December 27, 2016 07:21 PM

Also, it will be great if you could suggest how to uninstall the R Essentials package that was loaded.

Tue December 27, 2016 07:19 PM

Hey, After installation I am getting errors in starting up my modeler stating "modeler server stopped" (I am not using modeler server, using modeler client on local Windows machine). Also, if I try to run a simple R code using R Transform, the same error appears. If I try to load a cache the same error occurs. Everytime stream gets halted. Please guide.

Sat December 10, 2016 11:01 AM

Mike, cannot get the R essentials installed for my Mac (El Capitan, latest version; SPSS stat 24 with upgrades, R 3.2.2), hangs when trying to unzip R packages (at 27%). I do not quite get the points 2 and 3 in your comment, the R-install directory for me is the default /Library/Frameworks/R.framework/Resources. Any help would be appreciated, thanks

Thu November 17, 2016 07:36 PM

Hello,

I managed to get R essentials installed for Mac. Process is basically the same apart from a couple things. FYI I did this on OSX El Capitan:

1. You must install R-3.2.2, I couldn't get that to happen through ports or homebrew. Instead, I went here:
https://cran.r-project.org/bin/macosx/old/ and installed the 3.2.2 pkg for mac.

2. Once installed the path is: /usr/local/bin

3. To enter the path you have to hit cmd + shift + g in the selection window and directly type in the path.

4. The install directory for pasw.rstats for me was: /Application/IBM/SPSS/Modeler/18/SPSSModeler.app/Contents/ext/bin

Mon October 10, 2016 08:35 AM

Hello, I tried to install R-Essentials for SPSS Modeller 18 64bit on Windows 7 Professional, but everytime I try I get an error message that my R version ist not supported.
I have R 3.2.0 installed both 32bit and 64bit. The problems occurs as well with R 3.2.1, R 3.2.2, R 3.2.3, R3.2.4 and R3.2.5 .
Confunsingly install log tells me, that checking R-version has been succesfull and installation has been been aborted by user (because the error message would not let me continue).
Can somebody help me with that problem?
Kind Regards

Wed September 14, 2016 04:59 PM

Hello.
I finally was able to install everything but I cannot run it. I get an error when I tried to do FA with dichotomous items. Any Idea why?
I have SPSS 24 and R 3.2 version

Thank you.

Sun June 26, 2016 08:37 PM

Managed to install it, thanks!

Fri June 24, 2016 06:21 PM

Hi,

I saw this question on GitHub also and Jon Peck replied - "Each version of the R Essentials has to be compiled against a specific version of R, so you need to install R3.1.x for V23." - https://github.com/IBMPredictiveAnalytics/R_Essentials_Statistics/issues/1

If you have other questions please let us know.

Thu June 23, 2016 12:59 PM

Thanks for the blog. However, I have installed R 3.3 on my 64-bit Windows machine with SPSS statistics 23 installed. When I try to install the appropriate R Essentials it asks 'where is R installed'. When I point it to the direction of R 3.3 I get an error stating that R 3.1 is not installed (which is true, but I would expect the two to work). Should I downgrade R to 3.1, or can R Essentials be updated?

Fri June 03, 2016 09:28 AM

Is it possible to have a installation guide for Mac?

Tue March 29, 2016 06:34 AM

Thanks!

Mon March 21, 2016 07:47 PM

Thanks, that's really helpful.
Can you please also do another walk through for installing R essential for Mac on Modeler.

Mon March 21, 2016 06:56 PM

Great summary, thanks Greg.