Skip to content

Shell Function not on Linux

3 messages · Brian Ripley, Dario Strbenac

#
Hello,

Using R for Windows, I am able to use the shell function :

R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

   ...                                               ...
Error in shell() : argument "cmd" is missing, with no default

But, on Linux, it isn't found.

R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

   ...                                               ...
Error: could not find function "shell"

Other base functions are found, though.
Error in xy.coords(x, y, xlabel, ylabel, log) : 
  argument "x" is missing, with no default
[1] 0

Both of these were new R sessions. What should I do now ? Both of the installations were done by me, but on the Linux server, even the system-wide installation of R maintained by the IT administrator doesn't have it.

~$ /usr/bin/R

R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)

   ...                                               ...
Error: could not find function "shell"

What should I do now ?

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
#
You should read the documentation.  shell() is specific to Windows, as 
on all other platforms system() runs a shell.  (This is an OS-level 
difference: Windows is not POSIX compliant.)

See also the manuals, e.g. 
http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Operating-system-access 
and FAQs, e.g.
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What-should-I-expect-to-behave-differently-from-the-Unix-version

This was really a question for R-help, not R-devel.
On 29/07/2013 08:00, Dario Strbenac wrote:

  
    
#
I did. Nowhere does it explicitly say it is only for Windows, and one of the arguments also mentions BASH in it, so that made me assume it works for Linux.