Having trouble using R with SPSS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Having trouble using R with SPSS

Poes, Matthew Joseph

Hi guys,

                I am running SPSS 19.  I had my IT guy install R version 2.10.1 and what he says is the right version of R essentials (which he says installed correctly).  When I type in the following command:

BEGIN PROGRAM R.

browser()

END PROGRAM.

A window pops up, but when I type “Q”, I get an error.  In fact, when I type any command, I get an error:

“Error: could not find function “SetOutputFromBrowser””

 

When I type this command:

 

BEGIN PROGRAM R. x <- "R plug-in is working properly" x END PROGRAM.

 

I’m told I should get:

 

BEGIN PROGRAM R. x <- "R plug-in is working properly" x END PROGRAM. [1] " R plug-in is working properly"

 

But the last part is missing.  What has gone wrong with the install?  My IT guy doesn’t want to reinstall anything until I have feedback from you folks, so he knows what to look for.

 

Matthew J Poes

Research Data Specialist

Center for Prevention Research and Development

University of Illinois

510 Devonshire Dr.

Champaign, IL 61820

Phone: 217-265-4576

email: [hidden email]

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Having trouble using R with SPSS

Tom1234
Hello Matthew,
I think you're missing a single piece of important code when using R from SPSS, I'm pretty sure that commands that would display things in R will not naturally display in SPSS you need to therefore tell the program to display the content.
You should have put:

BEGIN PROGRAM R. 
print("R plug-in is working properly")
END PROGRAM.

See where I got my information HERE

"Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever."
Reply | Threaded
Open this post in threaded view
|

Re: Having trouble using R with SPSS

Jon K Peck
If things are working, R text and graphics output automatically appears in the Statistics Viewer.  You can test whether the code is actually running another way.  Run this program, which should pop up an R browser window inside Statistics
begin program r.
browser()
end program.

Use Q to close that window.  If the window does not appear, the code is not running at all.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Tom1234 <[hidden email]>
To:        [hidden email]
Date:        06/21/2012 04:20 AM
Subject:        Re: [SPSSX-L] Having trouble using R with SPSS
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hello Matthew,
I think you're missing a single piece of important code when using R from
SPSS, I'm pretty sure that commands that would display things in R will not
naturally display in SPSS you need to therefore tell the program to display
the content.
You should have put:



See where I got my information
http://people.cst.cmich.edu/lee1c/spss/Integrate_R.htm#Writing_an_R_program_to_be_integrated_with_SPSS
HERE

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Having-trouble-using-R-with-SPSS-tp5650658p5713739.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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