Re: [R] Running R from SAS

2010-11-25 Thread Eric Lecoutre
Ziad,

Also you didn't mention which version of SAS and which modules.
In case you are working with 9.2 and have at disposal IML, you can have a
look at
http://support.sas.com/documentation/cdl/en/imlsstat/63545/HTML/default/viewer.htm#statr_toc.htm

Eric



2010/11/24 

> Hello All,
>
> I am interested in running an R program with several random seeds.  One
> approach is to launch the program from SAS.  The recommended approach is to
> use the X command as shown below:
> OPTIONS XWAIT XSYNC;
>
> X "r.exe --no-save --quiet <""c:\temp\r\program.r""
> >""c:\temp\r\program.log""";
>
> However, this does not seem to work for me.  Does anyone know how to launch
> an R program from SAS?  Thank you in advance.
>
> Ziad Elmously
>
> ziad.elmou...@tnsglobal.com
>
>
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Eric Lecoutre
Consultant - Business & Decision
Business Intelligence & Customer Intelligence

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Running R from SAS

2010-11-24 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of ziad.elmou...@tnsglobal.com
> Sent: Wednesday, November 24, 2010 3:27 AM
> To: r-help@r-project.org
> Subject: [R] Running R from SAS
> 
> Hello All,
> 
> I am interested in running an R program with several random seeds.  One
> approach is to launch the program from SAS.  The recommended approach
> is to use the X command as shown below:
> OPTIONS XWAIT XSYNC;
> 
> X "r.exe --no-save --quiet <""c:\temp\r\program.r""
> >""c:\temp\r\program.log""";
> 
> However, this does not seem to work for me.  Does anyone know how to
> launch an R program from SAS?  Thank you in advance.
> 
> Ziad Elmously
> 
> ziad.elmou...@tnsglobal.com
> 
> 

You haven't given enough information for anyone to offer you anything more than 
educated guesses.  What do you mean " this does not seem to work for me"?  What 
error messages are you getting.  

If you want to run R from SAS (or any other program) you need to figure out 
what command will work from the command line.  I assume your unstated OS is 
some version of MS Windows.  What version of R?  Is R.exe in your path?  If not 
you need either need to add the path to SAS to your PATH environment variable, 
or you need to give the full path in the x command.

Try entering your command at the windows command prompt (you have no spaces in 
your filenames/paths so the quotes aren't necessary)

   R --no-save --quiet c:\SAS_examples\run_R_from_SAS_test.out';

Since I have R in my PATH, I could have just used

   x 'R --vanilla c:\SAS_examples\run_R_from_SAS_test.out';

I could have also used Rcmd BATCH like this; 

  x 'Rcmd BATCH --vanilla c:\SAS_examples\run_R_from_SAS_test.R';

and the output would be placed in c:\SAS_examples\run_R_from_SAS_test.Rout 
automatically.

Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Running R from SAS

2010-11-24 Thread Ziad.Elmously
Hello All,
 
I am interested in running an R program with several random seeds.  One 
approach is to launch the program from SAS.  The recommended approach is to use 
the X command as shown below:
OPTIONS XWAIT XSYNC;

X "r.exe --no-save --quiet <""c:\temp\r\program.r"" >""c:\temp\r\program.log""";

However, this does not seem to work for me.  Does anyone know how to launch an 
R program from SAS?  Thank you in advance.

Ziad Elmously

ziad.elmou...@tnsglobal.com

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.