[Rd] Shell Function not on Linux

2013-07-29 Thread 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)

   ...   ...

> 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

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Shell Function not on Linux

2013-07-29 Thread 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

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel




--
Brian D. Ripley,  rip...@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, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Shell Function not on Linux

2013-07-29 Thread Dario Strbenac
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: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf 
of Prof Brian Ripley [rip...@stats.ox.ac.uk]
Sent: Monday, 29 July 2013 5:08 PM
To: r-devel@r-project.org
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
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,  rip...@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, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] duplicated.data.frame() is broken on data frames containing \r

2013-07-29 Thread Hervé Pagès

Hi,

The trick used by duplicated.data.frame() is to transform the supplied
data.frame into a character vector by pasting together the columns using
"\r" as separator. But no precautions are taken to deal with "\r" in
the supplied data.frame. As a consequence it's easy to imagine
situations where duplicated.data.frame() returns an incorrect answer:

  > df <- data.frame(a=c("AA", "AA\r"), b=c("\rBBB", "BBB"))
  > df
   a b
  1   AA \rBBB
  2 AA\r   BBB
  > duplicated(df)
  [1] FALSE  TRUE

Cheers,
H.

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] duplicated.data.frame() is broken on data frames containing \r

2013-07-29 Thread Hervé Pagès

OK it's actually documented:

 The data frame method works by pasting together a character
 representation of the rows separated by ‘\r’, so may be imperfect
 if the data frame has characters with embedded carriage returns or
 columns which do not reliably map to characters.

But what about fixing it? One possible fix is to use "\r\r" as
separator and to substitute user-supplied "\r" with, say, "#\r#".
Just an example.

Thanks,
H.


On 07/29/2013 11:52 AM, Hervé Pagès wrote:

Hi,

The trick used by duplicated.data.frame() is to transform the supplied
data.frame into a character vector by pasting together the columns using
"\r" as separator. But no precautions are taken to deal with "\r" in
the supplied data.frame. As a consequence it's easy to imagine
situations where duplicated.data.frame() returns an incorrect answer:

   > df <- data.frame(a=c("AA", "AA\r"), b=c("\rBBB", "BBB"))
   > df
a b
   1   AA \rBBB
   2 AA\r   BBB
   > duplicated(df)
   [1] FALSE  TRUE

Cheers,
H.

 > sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C LC_NAME=C
  [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base




--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel