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

David Winsemius dwinsemius at comcast.net
Thu Mar 25 05:00:48 CET 2010


On Mar 24, 2010, at 8:57 PM, Gi-Mick Wu wrote:

> Thanks everyone!
>
> Of course it had to be simple.
>
> Someday, I may get rid of the annoying point & click; for now I'm  
> recovering from Windows.

Now _that_ is amusing. Windows is a (kludgy) imitation of the Mac GUI,  
which in turn is a copy of the Xerox PARC Alto and Star systems, all  
of which feature the mouse for user input.

>
> Cheers,
> Mick
>
> On 2010-03-24, at 5:50 PM, Rolf Turner wrote:
>
>>
>> On 25/03/2010, at 1:48 PM, Kasper Daniel Hansen wrote:
>>
>>> On Wed, Mar 24, 2010 at 8:35 PM, Rolf Turner <r.turner at auckland.ac.nz 
>>> > wrote:
>>>> Note that Mac OSX is really Unix (with an annoying point-and- 
>>>> click veneer
>>>> pasted on top of it) so you don't need to mess around with this  
>>>> ``open''
>>>> nonsense.  Just make ``filename'' executable.  Then you can do
>>>>
>>>>> system(filename)
>>>>
>>>> Or if ``filename'' is not executable and you don't want to bother  
>>>> making
>>>> it so, do
>>>>
>>>>> system(paste("source",filename))
>>>
>>> So you are claiming that if I make a PDF file executable, executing
>>> the file will open it up in a pdf viewer.  Interesting.
>>
>> No, I am obviously not claiming that at all.  You are just being
>> silly/deliberately obtuse.

That is what Rolf implied. Agreed, it sounded a bit like arcanity or  
perhaps nonsense. Using "source" on a pdf file?  In any case, this is  
another example of using system() to open a pdf file.

  system("open /Users/davidwinsemius/Downloads/research-2004-05-ind- 
life-rpt.pdf")

Kasper's solution also works _iff_ the filename object has been  
previously defined.


-- 
David

>>
>> 	cheers,
>>
>> 		Rolf Turner



More information about the R-SIG-Mac mailing list