Re: [Rd] R-devel Digest, Vol 133, Issue 23

2014-03-26 Thread Hervé Pagès
Hi, On 03/26/2014 10:24 AM, Radford Neal wrote: From: Richard Cotton The rep function is very versatile, but that versatility comes at a cost: it takes a bit of effort to learn (and remember) its syntax. This is a problem, since rep is one of the first functions many beginners will come across

Re: [Rd] R-devel Digest, Vol 133, Issue 23

2014-03-26 Thread Prof Brian Ripley
On 26/03/2014 22:00, peter dalgaard wrote: On 26 Mar 2014, at 18:24 , Radford Neal wrote: From: Richard Cotton The rep function is very versatile, but that versatility comes at a cost: it takes a bit of effort to learn (and remember) its syntax. This is a problem, since rep is one of the fi

Re: [Rd] R-devel Digest, Vol 133, Issue 23

2014-03-26 Thread peter dalgaard
On 26 Mar 2014, at 18:24 , Radford Neal wrote: >> From: Richard Cotton >> >> The rep function is very versatile, but that versatility comes at a >> cost: it takes a bit of effort to learn (and remember) its syntax. >> This is a problem, since rep is one of the first functions many >> beginners

Re: [Rd] internal string comparison (Scollate)

2014-03-26 Thread Romain François
Le 26 mars 2014 à 18:03, Gabriel Becker a écrit : > On Wed, Mar 26, 2014 at 9:50 AM, Dirk Eddelbuettel wrote: > > On 26 March 2014 at 17:22, Romain François wrote: > | I’d like to compare two strings internally the way R would, so I need > Scollate which is not part of the authorized R api. >

Re: [Rd] [Bioc-devel] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Hervé Pagès
Hi, I agree. I can't think of an easy way to avoid this kind of clashes between BioC and non-BioC S4 generics, other than by having things like sort() already defined as an S4 generic in base R. Note that, just having setMethod("sort", ...) in your package Ulrich, and not putting a setGeneric()

Re: [Rd] NOTE when detecting mismatch in output, and codes for NOTEs, WARNINGs and ERRORs

2014-03-26 Thread Paul Gilbert
On 03/26/2014 04:58 AM, Kirill Müller wrote: Dear list It is possible to store expected output for tests and examples. From the manual: "If tests has a subdirectory Examples containing a file pkg-Ex.Rout.save, this is compared to the output file for running the examples when the latter are ch

Re: [Rd] R-devel Digest, Vol 133, Issue 23

2014-03-26 Thread Radford Neal
> From: Richard Cotton > > The rep function is very versatile, but that versatility comes at a > cost: it takes a bit of effort to learn (and remember) its syntax. > This is a problem, since rep is one of the first functions many > beginners will come across. Of the three main uses of rep, two h

Re: [Rd] internal string comparison (Scollate)

2014-03-26 Thread Gabriel Becker
On Wed, Mar 26, 2014 at 9:50 AM, Dirk Eddelbuettel wrote: > > On 26 March 2014 at 17:22, Romain François wrote: > | I'd like to compare two strings internally the way R would, so I need > Scollate which is not part of the authorized R api. > | > | So: > | - Can Scollate (and perhaps Seql) be pro

Re: [Rd] internal string comparison (Scollate)

2014-03-26 Thread Dirk Eddelbuettel
On 26 March 2014 at 17:22, Romain François wrote: | I’d like to compare two strings internally the way R would, so I need Scollate which is not part of the authorized R api. | | So: | - Can Scollate (and perhaps Seql) be promoted to api ? | - If not what are the alternatives ? Using strcmp o

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread John Chambers
I haven't looked at this in detail, but my guess is the following is the distinction: A simple call setGeneric("sort") makes a generic of the existing function _with the existing package_: > setGeneric("sort") [1] "sort" > sort standardGeneric for "sort" defined from package "base" function

[Rd] internal string comparison (Scollate)

2014-03-26 Thread Romain François
Hello, I’d like to compare two strings internally the way R would, so I need Scollate which is not part of the authorized R api. So: - Can Scollate (and perhaps Seql) be promoted to api ? - If not what are the alternatives ? Using strcmp or stroll does not seem as general as Scollate. Ro

Re: [Rd] The case for freezing CRAN

2014-03-26 Thread Geoff Jentry
On Thu, 20 Mar 2014, Dirk Eddelbuettel wrote: o Roger correctly notes that R scripts and packages are just one issue. Compilers, libraries and the OS matter. To me, the natural approach these days would be to think of something based on Docker or Vagrant or (if you must, VirtualBox). The

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Ulrich Bodenhofer
First of all, thanks for the very interesting and encouraging replies that have been posted so far! Let me quickly add what I have tried up to now: - setMethod("sort", signature("ExClust"), function(x, decreasing=FALSE, %...%) %...% , sealed=TRUE) without any call to setGeneric(), i.e. assumi

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Duncan Murdoch
On 26/03/2014, 9:13 AM, Gabriel Becker wrote: Perhaps a patch to R such that generics don't clobber each-other's method tables if the signatures agree? I haven't dug deeply, but simply merging the method tables seems like it would be safe when there are no conflicts. That way this type of multip

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Michael Lawrence
That might be worth thinking about generally, but it would still be nice to have the base generics pre-defined, so that people are not copy and pasting the definitions everywhere, hoping that they stay consistent. On Wed, Mar 26, 2014 at 6:13 AM, Gabriel Becker wrote: > Perhaps a patch to R such

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Gabriel Becker
Perhaps a patch to R such that generics don't clobber each-other's method tables if the signatures agree? I haven't dug deeply, but simply merging the method tables seems like it would be safe when there are no conflicts. That way this type of multiplicity would not be a problem, though it wouldn'

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Michael Lawrence
The BiocGenerics package was designed to solve this issue within Bioconductor. It wouldn't be the worst thing in the world to depend on the simple BiocGenerics package for now, but ideally the base generics would be defined higher up, perhaps in the methods package itself. Maybe someone else has a

[Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Ulrich Bodenhofer
[cross-posted to R-devel and bioc-devel] Hi, I am trying to implement a 'sort' method in one of the CRAN packages I am maintaining ('apcluster'). I started with using setMethod("sort", ...) in my package, which worked fine. Since many users of my package are from the bioinformatics field, I w

[Rd] NOTE when detecting mismatch in output, and codes for NOTEs, WARNINGs and ERRORs

2014-03-26 Thread Kirill Müller
Dear list It is possible to store expected output for tests and examples. From the manual: "If tests has a subdirectory Examples containing a file pkg-Ex.Rout.save, this is compared to the output file for running the examples when the latter are checked." And, earlier (written in the context