[R] open script file from command line

David Winsemius dwinsemius at comcast.net
Fri Feb 5 03:25:18 CET 2010

On Feb 4, 2010, at 7:53 PM, Wade Wall wrote:

> Hi all,
> Is there a function to open a script file from the command line?  I  
> have
> several students who are Mac users and when they open up a script  
> file it
> does not send commands to the console, and unfortunately I don't  
> know how to
> solve this problem since I am not a Mac user.
> I have looked over the FAQ for Mac users, but didn't see a reference  
> to the
> problem.

It is important when discussing Mac <-> R interactions to distinguish  
between the persons who run R from the command line and perhaps the  
larger group that uses the nicely designed R.app and r64.app GUI's.

The GUI is missing some of the features that are present in the  
Windows GUI's, but it has other facilities missing in the Windows GUI.  
You can execute the console version with command line arguments. Your  
students may not know how to use the Terminal.app which will open up a  
shell window. You will need to decide whether to spend the time to  
teach them that useful skill set or not.

This is what the R Mac FAQ says about external editors:
"6.2 External editors
R accepts the Apple Event command open. This means than an external  
editor can communicate with R sending portions of R code to execute  
via files. This is the approach used by the R-Tcl Mode in Alpha X (see http://www.kelehers.org/alpha/) 
.  "

You may find additional information here:




-- David.

> I think they are both using OS X.
> Thanks for any help.
> Wade
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

More information about the R-help mailing list