Thanks for pointing this out. Haven't encountered this S4 ... behavior..
before. Worked around it by forcing our own generic, rather than relying on
the implicit one. Could this be a bug in S4? Annoyingly, the IRanges start
up message is now longer, due to the masking of package stats. Somebody
needs to remove the newlines from that message.

On Thu, Dec 10, 2009 at 12:17 PM, Kasper Daniel Hansen <
khansen@stat.berkeley.edu> wrote:

> After loading IRanges, complete.cases ceases to work (see below).  Test via
> example("complete.cases", package = "stats")
>
> To avoid stuff like this in the future, perhaps it would make sense to
> think of some kind of testing for packages making an S4 generic out of a
> "base" function.
>
> Kasper
>
> compute-0-5:~/> R-devel
>
> R version 2.11.0 Under development (unstable) (2009-12-08 r50689)
> Copyright (C) 2009 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>  Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
> > example(complete.cases)
>
> cmplt.> x <- airquality[, -1] # x is a regression design matrix
>
> cmplt.> y <- airquality[,  1] # y is the corresponding response
>
> cmplt.> stopifnot(complete.cases(y) != is.na(y))
>
> cmplt.> ok <- complete.cases(x,y)
>
> cmplt.> sum(!ok) # how many are not "ok" ?
> [1] 42
>
> cmplt.> x <- x[ok,]
>
> cmplt.> y <- y[ok]
> > library(IRanges)
>
> Attaching package: 'IRanges'
>
>
>        The following object(s) are masked from package:base :
>
>         cbind,
>         Map,
>         mapply,
>         order,
>         pmax,
>         pmax.int,
>         pmin,
>         pmin.int,
>         rbind,
>         rep.int,
>         table
>
> > example(complete.cases, package = "stats")
>
> cmplt.> x <- airquality[, -1] # x is a regression design matrix
>
> cmplt.> y <- airquality[,  1] # y is the corresponding response
>
> cmplt.> stopifnot(complete.cases(y) != is.na(y))
> Error: '...' used in an incorrect context
> Error in complete.cases(y) :
>  error in evaluating the argument '...' in selecting a method for function
> 'complete.cases'
> > sessionInfo()
> R version 2.11.0 Under development (unstable) (2009-12-08 r50689)
> x86_64-unknown-linux-gnu
>
> locale:
>  [1] LC_CTYPE=en_US.iso885915       LC_NUMERIC=C
>  [3] LC_TIME=en_US.iso885915        LC_COLLATE=en_US.iso885915
>  [5] LC_MONETARY=C                  LC_MESSAGES=en_US.iso885915
>  [7] LC_PAPER=en_US.iso885915       LC_NAME=C
>  [9] LC_ADDRESS=C                   LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] IRanges_1.5.16
>
> loaded via a namespace (and not attached):
> [1] tools_2.11.0
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

