Søren Højsgaard
2003-Jul-23 12:44 UTC
[R] Strange behaviour when running R from within Emacs on Winddows
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? Thanks S?ren
Prof Brian Ripley
2003-Jul-23 15:56 UTC
[R] Strange behaviour when running R from within Emacs on Winddows
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