• Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

Comments (10)

1 Gwylym commented Permalink

Why is the R essentials limited to using R 2.15? The current version is 3.02.

2 JonPeck commented Permalink

We know. We generally integrate with the latest stable version of R at the time we have to make our cut for a Statistics release. We have to use R header files from a particular R version in order to compile our code, and we have to get that R distribution approved by Legal before we can ship as well as do all our QA testing. We hope to loosen the requirement of a specific R version at some point in the future. However, you can have multiple R versions installed on the same machine without them interfering with each other. I have six.

3 Gwylym commented Permalink

Is there a document that gives a quick guide to installing multiple versions of R?


4 JonPeck commented Permalink

There are no special instructions for installing multiple R versions. Beyond the obvious requirement that they be installed in different directories, you would just select the version you want from the R CRAN site (not always easy to find but look under Previous Releases), and do the standard R install. Only the first two parts of the R version number matter for Statistics. I avoid installing R under Program Files, since then Admin rights are required in some cases, but that's just a convenience.

Statistics will automatically find and use the installed R version that it requires.

5 Flavio_F commented Permalink

Dear Jon,

I implemented a few R functions of mine in SPSS (Version 22) using the plugin for R. It all works very fine aside from the speed of execution. When implemented in R alone, these functions run nearly instantaneusly, but take almost 20 seconds to run within the SPSS-R integrated system. I would like to create user-friendly custom dialogues for routine requests on data, and 20 sec for each request is really a limiting factor.
I tried to move away from the basic "BEGIN PROGRAM R - END PROGRAM" implementation and wrapped the functions in an extension command, in the hope that this might increase speed, but the running time remained exactly the same.
Is there any trick one can apply to increase execution speed?
Or do I have to live with it?
Many thanks in advance for your reply!

6 JonPeck commented Permalink

The R code running within Statistics should run at the same speed as running in R standalone once the R engine is started. And once started, that process will continue to be available through the Statistics session without restarting. However, data transfer between the Statistics backend process and the R process or vice versa is slow. Can you identify where the time is being spent in the R code?

7 Flavio_F commented Permalink

Dear Jon. Thank you so much for the extremely quick reply! You are absolutely right, all the time is indeed spent for the data transfer. I checked it by just transfering my dataset from SPSS to R and back without doing any computations inbetween.The problem lies probably in the size of the dataset, which is quite large (ca. 23000 rows x 300 columns). I guess the only solution is then to first subset the dataset in SPSS and send to R only the specific subset needed for a given analysis? Should find a way to automate that though, I'm unfortunately not yet very familiar with SPSS syntax.

8 JonPeck commented Permalink

The biggest slowdown is in writing back to Statistics, especially with a lot of variables, so if you can only request the variables you actually need, things should go faster.

9 Flavio_F commented Permalink

... oh well, of course I can transfer the whole dataset once at the beginning of the session and that's it, instead of having the data transfer step embedded in the function at each request. Well, thank you so much!!

10 Flavio_F commented Permalink

Sorry, to avoid misunderstandings, I wrote the last comment before having seen yours. I guess it should also be possible to transfer the dataset once at the beginning of the session, and then run multiple requests on it from SPSS?

Add a Comment Add a Comment