Re: [R] Call SAS from R
hi , Ihave you try to use the package foreign ? try it may be you will see how to read foreign data file. Sincerly ! - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Call SAS from R
Hi All, I am new to post question on this list. I apologize if this question is too easy or irrelevant. I am doing a simulation study and I need to read a data file that can be easily read by SAS. So, what I try to do is to execute SAS in R and then read the output of SAS to R. I try the following code but it didn't work. system(c:\\program files\\sas institute\\v8\\sas.exe test) can anyone give me some help with this? Thanks. Davoid This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Call SAS from R
perhaps it would be easier to read directly your datafile from R ? read.table(...) is your friend, and quite easy to use. type ?read.table under R. hih __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Call SAS from R
Thanks for some kind responses from the list. Maybe I should present my data here a little bit to explain why I want to use SAS. Below is part of my data set. First, I need to skip the first 9 lines which I can use skip=9 to do this. Second, I need to read to rows of data. the first row starts with M01 and ends before M02. The second row starts with M02 to the end. Thanks for all the helps. I will appreciate if someone can answer my original question or help me read this data in R. G08MX.PLS YEAR X CALIBRATION AUTOMATED FILE GENERATION TEST 01 50 50701 111111111111111 111111111111111 111111111111111 11111 GROUP 01 M01 20001 0.64822 0.03298 -1.25144 0.13812 0.16387 0.05688 0.0 0.0 0.0 0.0 M02 20002 1.02401 0.04124 -0.56511 0.04894 0.12076 0.02445 0.0 0.0 0.0 0.0 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, August 24, 2005 10:58 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] Call SAS from R perhaps it would be easier to read directly your datafile from R ? read.table(...) is your friend, and quite easy to use. type ?read.table under R. hih __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html This email may contain confidential material.\ If you were n...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Call SAS from R
On Wed, 24 Aug 2005, Shin, David wrote: ... system(c:\\program files\\sas institute\\v8\\sas.exe test) Warning message: c:\program not found Escape the spaces too. It is trying to run the program c:\program or c:\progra~1\sas Dave -- Dr. David Forrest [EMAIL PROTECTED](804)684-7900w [EMAIL PROTECTED] (804)642-0662h http://maplepark.com/~drf5n/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Call SAS from R
Date: Wed, 24 Aug 2005 18:05:44 +0100 (BST) From: Prof Brian Ripley [EMAIL PROTECTED] To: David Forrest [EMAIL PROTECTED] Cc: Shin, David [EMAIL PROTECTED], r-help@stat.math.ethz.ch, 'Don MacQueen' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [R] Call SAS from R On Wed, 24 Aug 2005, David Forrest wrote: On Wed, 24 Aug 2005, Shin, David wrote: ... system(c:\\program files\\sas institute\\v8\\sas.exe test) Warning message: c:\program not found Escape the spaces too. It is trying to run the program c:\program or c:\progra~1\sas Sorry that does not work. The Windows way is to quote it: e.g. system('c:/Program Files/Mozilla Firefox/firefox.exe') works (note the two sets of quotes), and this is explained with an example on the help page ?system, so please do as the posting guide asks and read the documentation -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html