[R-SIG-Mac] shell.exe() equivalent?

Scott Mitchell smitch at me.com
Thu Mar 25 01:21:43 CET 2010


On 2010-03-24, at 19:37, Gi-Mick Wu <mick.wu at mail.mcgill.ca> wrote:

>
> Does anyone know whether there is the equivalent of shell.exe 
> (filename)?
...
> ### Example:
> pdf(filename, ... )
>   plot( ... )
> dev.off()
> shell.exec(filename)

On any unix-based system you can use the system() function, and on the  
Mac you can combine that with the open command to get the default  
software to handle the file, so the last line in your example would  
change to:

system("open filename")



More information about the R-SIG-Mac mailing list