Re: [R] Calling SAS from R
Did you read the help(system)? You should use ``/'', not ''\'' for you path delimiter in R. The following is a simple example for opening a pdf reader. system(paste('"C:/Program Files/Foxit Software/Foxit Reader/Foxit Reader.exe"'), wait = FALSE) It' also easy to modify the example shown in help(system). with regards Guo-Hao Huang -- From: "Yen Lee" Sent: Monday, March 01, 2010 3:42 PM To: Subject: Re: [R] Calling SAS from R Thank you for your reply. Because my R program is Chinese version, I would try my best to translate and specify my question more precisely. When I type system('"c:\\Program Files\\SAS\\SAS 9.1\\sas.exe","c:\\entropy\\output7\\scale\\syntax.sas"') The warning message is as follow, In system("\"c:\\Program Files\\SAS\\SAS 9.1\\sas.exe\",\"c:\\entropy\\output7\\scale\\syntax.sas\"") : "c:\Program Files\SAS\SAS 9.1\sas.exe","c:\entropy\output7\scale\syntax.sas" is not be found When I try system('"c:\\Program Files\\SAS\\SAS 9.1\\sas.exe"','"c:\\entropy\\output7\\scale\\syntax.sas"') The warring message is as follow, The mistake is if (intern) flag <- 3L else { : The argument can not be interpreted as the logical value. These commands also don't work outside R, but I also don't know how to modify. I guess it's because I lose a command to tell SAS to read the file, but I don't know how to do this. Hope it's clear enough. Can anyone give me some help with this? Thanks~ Yen -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben Bolker Sent: Monday, March 01, 2010 12:32 AM To: r-h...@stat.math.ethz.ch Subject: Re: [R] Calling SAS from R Yen Lee ntu.edu.tw> writes: I apologize if my sentence is not fluent to read. I am doing a simulation study and I need to execute SAS and read a SAS code in R. I try the following code but it doesn't work. system('"c:\\program files\\SAS\\SAS 9.1\\sas.exe" "c:\\syntax.sas"') can anyone give me some help with this? You need to tell us, as precisely as possible, what "doesn't work" means. Did R produce warnings or error messages? What were they? If you run the equivalent command (the same except for single vs double backslashes and surrounding quotation marks) "c:\program files\SAS\SAS 9.1\sas.exe" "c:\syntax.sas" outside of R (in a terminal window or from the "Run" box in Windows), does it work? __ 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. [[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. __ 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] ANNOUNCE--Rdsm package, a threads-like environment for R
I am interested in Rdsm package, but I have no idea about how to use it. Where can I find examples? regards Guo-Hao Huang -- From: "Norm Matloff" Sent: Thursday, March 11, 2010 1:37 PM To: ; Subject: [R] ANNOUNCE--Rdsm package, a threads-like environment for R My long-promised Rdsm package is now on CRAN. Some of you may recall that I made a prototype available on my own Web page last July. This is the official version, much evolved since I released the prototype. The CRAN description states: Provides a threads-like programming environment for R, usable both on a multicore machine and across a network of multiple machines. The package gives the illusion of shared memory, again even across multiple machines on a network. This is based on a similar package I wrote for Perl back in 2002. Rdsm should complement the bigmemory package written by Mike Kane and Jay Emerson. As noted above and in my July announcement for my prototype, Rdsm works across a network of machines, while bigmemory is limited to multicore platforms. On the other hand, bigmemory is capable of handling huge data structures, which Rdsm is not. Rdsm is intended for parallel/distributed computing, while bigmemory is currently used primarily for the problems its name implies. However, if bigmemory is used as a parallel R vehicle on a multicore machine, it may be faster than Rdsm for some applications, given its direct use of bare shared memory; typically, though, they should provide similar performance in such contexts. By the way, I have a prototype of an infrastructure package to facilitate using bigmemory as a parallel R engine. Norm Matloff University of California, Davis __ 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-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] how can I use R functions in Fortran 90
You can read the manual below. good luck! http://www.biometrics.mtu.edu/CRAN/doc/manuals/R-exts.html#The-R-API For example, suppose we want to call R's normal random numbers from FORTRAN. We need a C wrapper along the lines of #include void F77_SUB(rndstart)(void) { GetRNGstate(); } void F77_SUB(rndend)(void) { PutRNGstate(); } double F77_SUB(normrnd)(void) { return norm_rand(); } to be called from FORTRAN as in subroutine testit() double precision normrnd, x call rndstart() x = normrnd() call dblepr("X was", 5, x, 1) call rndend() end Note that this is not guaranteed to be portable, for the return conventions might not be compatible between the C and FORTRAN compilers used. (Passing values via arguments is safer.) with regards, Guo-Hao Huang -- From: "Anny Huang" Sent: Tuesday, December 29, 2009 1:45 PM To: Subject: [R] how can I use R functions in Fortran 90 Hi all, Is there a way that I can import R functions into Fortran? Especially, I want to generate random numbers from some not-so-common distributions (e.g. inverted chi square) but did not find any routines written in Fortran that deal with distributions other than uniform and normal. Thanks. Anny [[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. __ 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] How to uninstall R packages
?remove.packages Guo-Hao Huang -- From: "wenjun zheng" Sent: Monday, January 04, 2010 11:20 PM To: Subject: [R] How to uninstall R packages Dear all, I am puzzled that how can i uninstall a R package that have been installed earlier (especially in MacOS). Any suggestion will be appreciated. -- Wenjun [[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. __ 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.