Shell Function not on Linux

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shell Function not on Linux

Dario Strbenac-2
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)

   ...                                               ...

> shell()
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)

   ...                                               ...

> shell()
Error: could not find function "shell"

Other base functions are found, though.

> plot()
Error in xy.coords(x, y, xlabel, ylabel, log) :
  argument "x" is missing, with no default
> sum()
[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)

   ...                                               ...

> shell()
Error: could not find function "shell"

What should I do now ?

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Shell Function not on Linux

Prof Brian Ripley
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:

> 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)
>
>     ...                                               ...
>
>> shell()
> 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)
>
>     ...                                               ...
>
>> shell()
> Error: could not find function "shell"
>
> Other base functions are found, though.
>
>> plot()
> Error in xy.coords(x, y, xlabel, ylabel, log) :
>    argument "x" is missing, with no default
>> sum()
> [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)
>
>     ...                                               ...
>
>> shell()
> Error: could not find function "shell"
>
> What should I do now ?
>
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Shell Function not on Linux

Dario Strbenac-2
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.


________________________________________
From: [hidden email] [[hidden email]] on behalf of Prof Brian Ripley [[hidden email]]
Sent: Monday, 29 July 2013 5:08 PM
To: [hidden email]
Subject: Re: [Rd] Shell Function not on Linux

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:

> 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)
>
>     ...                                               ...
>
>> shell()
> 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)
>
>     ...                                               ...
>
>> shell()
> Error: could not find function "shell"
>
> Other base functions are found, though.
>
>> plot()
> Error in xy.coords(x, y, xlabel, ylabel, log) :
>    argument "x" is missing, with no default
>> sum()
> [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)
>
>     ...                                               ...
>
>> shell()
> Error: could not find function "shell"
>
> What should I do now ?
>
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel