[R] Strange behaviour when running R from within Emacs on Winddows

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jul 23 17:56:47 CEST 2003


On Wed, 23 Jul 2003, Søren Højsgaard wrote:

> Dear R-experts,
> I run R in a shell under Emacs on Win2k using ESS. I get the following strange error
> 
> > shell("copy c:\\file.txt c:\\newfile.txt")
> warning: extra args ignored after 'copy'
> Forkert syntaks for kommandoen.
> Warning message: 
> cmd execution failed with error code 1 in: shell("copy c:\\file.txt c:\\newfile.txt") 
> 
> The same problem emerges independently of whether I use a dos or bash as shell! 
> 
> However, if I run the shell() thing in the Gui, things work fine and so do they in Rterm
> 
> Can anyone help me?

I suspect Emacs/ESS has set the SHELL variable: you can ask shell to use a 
specific shell via its second argument or by setting R_SHELL.

bash won't work, as `copy' is a DOS internal command.

Why don't you just use file.copy()?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595




More information about the R-help mailing list