Skip to content
Back to formatted view

Raw Message

Message-ID: <FA3C59A9-E060-4993-A283-F5952BCD8449@me.com>
Date: 2010-03-25T00:21:43Z
From: Scott Mitchell
Subject: shell.exe() equivalent?
In-Reply-To: <CFB0B72A-E68F-4105-A345-BF68D2607B6A@mail.mcgill.ca>

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")