Topic
  • 6 replies
  • Latest Post - ‏2012-08-16T10:17:55Z by SergeRij
mflash
mflash
4 Posts

Pinned topic No response from SPSS when running script - neither error/output

‏2010-12-20T18:39:52Z |
Hello!

I've just installed R and everything works fine in plain R window but I can't SPSS to react to any of the example scripts except the help script:

BEGIN PROGRAM R. help(paste) END PROGRAM.


The previous results in a jump to the localhost web-browser as expected.

When running a more complicated script from the manual nothing happens:

DATA LIST FREE /id (F4) gender (A1) training (F1). VARIABLE LABELS id 
'Employee ID' /training 
'Training Level'. VARIABLE LEVEL id (SCALE) /gender (NOMINAL) /training (ORDINAL). VALUE LABELS training 1 
'Beginning' 2 
'Intermediate' 3 
'Advanced' /gender 
'f' 
'Female' 
'm' 
'Male'.   BEGIN DATA 18 m 1 37 f 2 10 f 3 END DATA.   DATASET NAME test_set. BEGIN PROGRAM R. vardict <- spssdictionary.GetDictionaryFromSPSS() print(vardict) END PROGRAM.


I've also tried some other scripts but nothing seems to generate any output.

I have the latest patches for SPSS 19.0 on a Windows 7 machine and I've installed R through the SPSS provided package (version 2.10.1)
Updated on 2012-08-16T10:17:55Z at 2012-08-16T10:17:55Z by SergeRij
  • SystemAdmin
    SystemAdmin
    396 Posts

    Re: No response from SPSS when running script - neither error/output

    ‏2010-12-20T19:56:55Z  
    You will probably need to contact Technical Support on this - maybe there is a permissions problem on the temporary directory used to capture the output, but try modifying your program like this to get more information on the state of things.

    BEGIN PROGRAM R.
    vardict <- spssdictionary.GetDictionaryFromSPSS()
    browser()
    print(vardict)
    END PROGRAM.

    That should bring up a window on your R session. You can examine the variables in the workspace to see what has been actually executed. q will close that window and resume the R program.

    Regards,
    Jon Peck
  • mflash
    mflash
    4 Posts

    Re: No response from SPSS when running script - neither error/output

    ‏2010-12-20T21:59:05Z  
    You will probably need to contact Technical Support on this - maybe there is a permissions problem on the temporary directory used to capture the output, but try modifying your program like this to get more information on the state of things.

    BEGIN PROGRAM R.
    vardict <- spssdictionary.GetDictionaryFromSPSS()
    browser()
    print(vardict)
    END PROGRAM.

    That should bring up a window on your R session. You can examine the variables in the workspace to see what has been actually executed. q will close that window and resume the R program.

    Regards,
    Jon Peck
    Strange problem:

    I've done a:
    
    BEGIN PROGRAM R. vardict <- spssdictionary.GetDictionaryFromSPSS() print(
    "hello") browser() print(vardict) print(
    "goodbye") browser() END PROGRAM.
    

    Actions
    1. The first hello doesn't get printed
    2. When I press enter it gives me the error: could not find function: "SetOutputFromBrowser"
    3. When I press enter again:
    3.1 it gives an error for vardict not found
    3.2 It successfully prints "goodbye"
    4. When I press enter a third time it exits the browser as expected

    There seems to be a missing connection between R and the output in my installation...
  • SystemAdmin
    SystemAdmin
    396 Posts

    Re: No response from SPSS when running script - neither error/output

    ‏2010-12-20T22:07:40Z  
    • mflash
    • ‏2010-12-20T21:59:05Z
    Strange problem:

    I've done a:
    <pre class="jive-pre"> BEGIN PROGRAM R. vardict <- spssdictionary.GetDictionaryFromSPSS() print( "hello") browser() print(vardict) print( "goodbye") browser() END PROGRAM. </pre>
    Actions
    1. The first hello doesn't get printed
    2. When I press enter it gives me the error: could not find function: "SetOutputFromBrowser"
    3. When I press enter again:
    3.1 it gives an error for vardict not found
    3.2 It successfully prints "goodbye"
    4. When I press enter a third time it exits the browser as expected

    There seems to be a missing connection between R and the output in my installation...
    It seems that something is really messed up in this installation. Please contact Technical Support. What platform are you on?

    Note that none of the output from the program should appear in the Viewer until the R program ends; then it is all (supposed to be) displayed.
  • mflash
    mflash
    4 Posts

    Re: No response from SPSS when running script - neither error/output

    ‏2010-12-20T22:10:38Z  
    • mflash
    • ‏2010-12-20T21:59:05Z
    Strange problem:

    I've done a:
    <pre class="jive-pre"> BEGIN PROGRAM R. vardict <- spssdictionary.GetDictionaryFromSPSS() print( "hello") browser() print(vardict) print( "goodbye") browser() END PROGRAM. </pre>
    Actions
    1. The first hello doesn't get printed
    2. When I press enter it gives me the error: could not find function: "SetOutputFromBrowser"
    3. When I press enter again:
    3.1 it gives an error for vardict not found
    3.2 It successfully prints "goodbye"
    4. When I press enter a third time it exits the browser as expected

    There seems to be a missing connection between R and the output in my installation...
    Found the issue: the SPSS library was located in wrong directory

    On my computer I have R under Program Files: C:\Program Files (x86)\R\R-2.10.1\
    For unknown reason the SPSS_Statistics_REssentials_19_win64.exe installed spss190 folder under C:\RBASE\library
    By moving the library from C:\RBASE\library\spss190 --> C:\Program Files (x86)\R\R-2.10.1\library\spss190 the issue is solved

    I'm a little confused how this happened since I have no recollection of choosing RBASE in any stage, I guess I must have missed something.

    Note: repairing by running SPSS_Statistics_REssentials_19_win64.exe does not fix this issue

    Thank you for your help

    PS Could IBM speed up this forum? It seems a little slow and the search isn't really helpful (a thread can occur several times)
  • SystemAdmin
    SystemAdmin
    396 Posts

    Re: No response from SPSS when running script - neither error/output

    ‏2010-12-20T22:18:30Z  
    • mflash
    • ‏2010-12-20T22:10:38Z
    Found the issue: the SPSS library was located in wrong directory

    On my computer I have R under Program Files: C:\Program Files (x86)\R\R-2.10.1\
    For unknown reason the SPSS_Statistics_REssentials_19_win64.exe installed spss190 folder under C:\RBASE\library
    By moving the library from C:\RBASE\library\spss190 --> C:\Program Files (x86)\R\R-2.10.1\library\spss190 the issue is solved

    I'm a little confused how this happened since I have no recollection of choosing RBASE in any stage, I guess I must have missed something.

    Note: repairing by running SPSS_Statistics_REssentials_19_win64.exe does not fix this issue

    Thank you for your help

    PS Could IBM speed up this forum? It seems a little slow and the search isn't really helpful (a thread can occur several times)
    I suppose you are running Windows 7, then. Perhaps the installer got confused or found another R installation. It should have confirmed the location with you, though.

    The IBM DeveloperWorks site, which hosts this forum, does often seem slow. We can't do anything about that, but you might be able to find a place to post a comment about the speed where the DeveloperWorks team will see it.
  • SergeRij
    SergeRij
    1 Post

    Re: No response from SPSS when running script - neither error/output

    ‏2012-08-16T10:17:55Z  
    • mflash
    • ‏2010-12-20T22:10:38Z
    Found the issue: the SPSS library was located in wrong directory

    On my computer I have R under Program Files: C:\Program Files (x86)\R\R-2.10.1\
    For unknown reason the SPSS_Statistics_REssentials_19_win64.exe installed spss190 folder under C:\RBASE\library
    By moving the library from C:\RBASE\library\spss190 --> C:\Program Files (x86)\R\R-2.10.1\library\spss190 the issue is solved

    I'm a little confused how this happened since I have no recollection of choosing RBASE in any stage, I guess I must have missed something.

    Note: repairing by running SPSS_Statistics_REssentials_19_win64.exe does not fix this issue

    Thank you for your help

    PS Could IBM speed up this forum? It seems a little slow and the search isn't really helpful (a thread can occur several times)
    This solution worked for me as well, using Windows 7 and SPSS 19. There seems to be a bug in the installation process, because the user does not choose this RBASE directory him/herself.
    THanks for sharing this solution!