[Rd] callNextMethod() doesn't pass down arguments

2009-03-03 Thread hpages
Hi, According to its man page, callNextMethod() (called with no argument) should call the next method "with the arguments to the current method passed down to the next method". But, for the "[[" and "[" generics (primitives), the argument after the dots doesn't seem to be passed down: setClass("

[Rd] "names<-" doesn't raise an error

2009-03-04 Thread hpages
Hi, When a method is not defined for an object, you expect to get an error. But this is not the case for "names<-". You can use "names<-" on any S4 object: it will remain silent, giving you the impression that it actually did something: setClass("A", representation(vals="numeric")) setMethod

[Rd] bug in classesToAM()

2009-04-18 Thread hpages
Hi, I can't get the non-abbreviated class names of the rows and the cols of the Adjacency Matrix: setClass("ClassWithALongName") setClass("SubclassOfClassWithALongName", contains="ClassWithALongName") Trying all possible values for 'abbreviate' (with R-2.9.0): classesToAM("SubclassOf

Re: [Rd] formal argument "envir" matched by multiple actual arguments

2009-06-02 Thread hpages
In fact reg.finalizer() looks like a dangerous feature. If the finalizer itself triggers (implicitely or explicitely) garbage collection, then bad things happen. In the following example, garbage collection is triggered explicitely (using R-2.9.0): setClass("B", representation(bb="environment

[Rd] Protection stack overflow

2009-07-15 Thread hpages
Hi, > gctorture(TRUE) > setGeneric("foo", function(x, y) standardGeneric("foo")) [1] "foo" > setMethod("foo", c("ANY", "ANY"), + function(x, y) cat("calling foo,ANY,ANY method\n") + ) Error: protect(): protection stack overflow Sorry this is something I already reported one week

[Rd] Pb with contrib.url() (PR#9131)

2006-08-07 Thread hpages
Hi lists, Recently I needed to download a few R packages for Unix, Windows and Mac OS X. The idea was to put them all together on a USB key in order to be able to install them on systems without network connection. It worked fine for the "src" and "win.binary" packages but I had the following pr

[Rd] install.packages(,type="source") broken on Windows

2006-09-08 Thread hpages
Hi, On Windows, 'install.packages(,type="source")' displays the same output than 'R CMD INSTALL --help' and doesn't install anything... This is with R version 2.4.0 alpha (2006-09-06 r39158). > install.packages('cat',type='source') trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/cat_0.0-6.

Re: [Rd] Strange behaviour of the [[ operator (PR#9263)

2006-09-30 Thread hpages
Hi Duncan, This is even more confusing with a matrix: > x <- matrix(5:-6, 3) > x [,1] [,2] [,3] [,4] [1,]52 -1 -4 [2,]41 -2 -5 [3,]30 -3 -6 > x[invisible(2),3] [1] -2 > x[2,invisible(3)] > .Last.value [1] -2 Tha

[Rd] Inaccuracy in ?convolve

2007-02-02 Thread hpages
Hi, Man page for 'convolve' says: conj: logical; if 'TRUE', take the complex _conjugate_ before back-transforming (default, and used for usual convolution). The complex conjugate of 'x', of 'y', of both? In fact it seems that it takes the complex conjugate of 'y' only which is OK

Re: [Rd] convolve: request for "usual" behaviour + some improvements + some fixes

2007-02-04 Thread hpages
Hi Martin, Thanks for taking the time to read me. Here is a followup, it's rather long but hopefully not too long (and not too boring) ;-) Quoting Martin Maechler <[EMAIL PROTECTED]>: > Thank you, Herve, > > > "Herve" == Herve Pages <[EMAIL PROTECTED]> > > on Fri, 02 Feb 2007 21:30:

[Rd] Wrong vector size reported by error message

2007-02-05 Thread hpages
Hi, On my system, I get the following error message: > big <- 2:(2**30) Error: cannot allocate vector of size 0 Kb Note the wrong "size 0 Kb" in the message! Cheers, H. > sessionInfo() R version 2.5.0 Under development (unstable) (2007-01-05 r40386) i686-pc-linux-gnu locale: LC_CTYPE=en_

[Rd] Build error with last R-devel tarball

2007-02-05 Thread hpages
Hi, On Windows, with last R-devel tarball (r40647) from ftp://ftp.stat.math.ethz.ch/Software/R/R-devel_2007-02-04.tar.gz I get the following build error: E:\biocbld\bbs-2.0-bioc\R\src\gnuwin32> make ... ... -- Making package utils adding build stamp to DESCRIPTION inst

Re: [Rd] Build error with last R-devel tarball

2007-02-06 Thread hpages
Quoting Prof Brian Ripley <[EMAIL PROTECTED]>: > This was fixed in SVN within a few hours. Tarballs are snapshots, please > check SVN before reporting problems. Thanks! I will check SVN before reporting problems with a tarball. Just hope that nobody will get too upset if I'm reporting a problem

Re: [Rd] extracting rows from a data frame by looping over the row names: performance issues

2007-03-03 Thread hpages
Hi Seth, Quoting Seth Falcon <[EMAIL PROTECTED]>: > Herve Pages <[EMAIL PROTECTED]> writes: > > So apparently here extracting with dat[i, ] is 300 times faster than > > extracting with dat[key, ] ! > > > >> system.time(for (i in 1:100) dat["1", ]) > >user system elapsed > > 12.680 0.396

Re: [Rd] extracting rows from a data frame by looping over the row names: performance issues

2007-03-03 Thread hpages
Quoting [EMAIL PROTECTED]: > In [.data.frame if you replace this: > > ... > if (is.character(i)) { > rows <- attr(xx, "row.names") > i <- pmatch(i, rows, duplicates.ok = TRUE) > } > ... > > by this > > ... > if (is.character(i)) { > rows <- attr(xx

Re: [Rd] extracting rows from a data frame by looping over the row names: performance issues

2007-03-03 Thread hpages
Quoting hadley wickham <[EMAIL PROTECTED]>: > On 3/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Quoting [EMAIL PROTECTED]: > > > In [.data.frame if you replace this: > > > > > > ... > > > if (is.character(i)) { > > > rows <- attr(xx, "row.names") > > > i <- pmatch

[Rd] Unexpected result of as.character() and unlist() applied to a data frame

2007-03-26 Thread hpages
Hi, > dd <- data.frame(A=c("b","c","a"), B=3:1) > dd A B 1 b 3 2 c 2 3 a 1 > unlist(dd) A1 A2 A3 B1 B2 B3 2 3 1 3 2 1 Someone else might get something different. It all depends on the values of its 'stringsAsFactors' option: > dd2 <- data.frame(A=c("b","c","a"), B=3:1, stringsAsFactors=F

Re: [Rd] Unexpected alteration of data frame column names

2007-05-17 Thread hpages
Hi, Thanks to both for your answers! Quoting Marc Schwartz <[EMAIL PROTECTED]>: > On Thu, 2007-05-17 at 10:54 +0100, Prof Brian Ripley wrote: > > To add to Marc's detective work. ?"[.data.frame" does say > > > > If '[' returns a data frame it will have unique (and non-missing) > > r

[Rd] pairlist objects

2007-10-01 Thread hpages
Hi, ?pairlist gives no explanation about what exactly is the difference between a pairlist and a list (except that a pairlist of length 0 is 'NULL'). So, what's a pairlist? class(.Options) [1] "pairlist" Some strange things about the "pairlist" type: > showClass("pairlist") Error in getClas

[Rd] slots of type "double"

2007-11-13 Thread hpages
Hi, Any idea why S4 doesn't allow slots of type "double"? > setClass("A", representation(a="double")) Error in makePrototypeFromClassDef(properties, ClassDef, immediate, where) : in making the prototype for class "A" elements of the prototype failed to match the corresponding slot class:

[Rd] Pb with lapply()

2008-01-31 Thread hpages
Hi, If needed, lapply() tries to convert its first argument into a list before it starts doing something with it: > lapply function (X, FUN, ...) { FUN <- match.fun(FUN) if (!is.vector(X) || is.object(X)) X <- as.list(X) .Internal(lapply(X, FUN)) } But in practice,

Re: [Rd] Pb with lapply()

2008-01-31 Thread hpages
Hi Gabor, Quoting Gabor Grothendieck <[EMAIL PROTECTED]>: > The problem of promises not being evaluated in > lists has been discussed before. > > I think its fixed in the development version of R. See > r44139 on Jan 24, 2008 in http://developer.r-project.org/R.svnlog.2007 > I'm using R-devel

[Rd] Cannot link mypackage to 2 other packages

2008-08-06 Thread hpages
Hi, I need to link mypackage to 2 other packages so I can call some C functions defined in these 2 packages from mine. I've tried Depends: packageA, packageB LinkingTo: packageA, packageB as suggested by the "5.4 Registering native routines" section of the "Writing R Extensions" manual but t

Re: [Rd] Cannot link mypackage to 2 other packages

2008-08-06 Thread hpages
Quoting Prof Brian Ripley <[EMAIL PROTECTED]>: What platform? 64-bit openSUSE Linux [EMAIL PROTECTED]:~> uname -a Linux george1 2.6.22.12-0.1-default #1 SMP 2007/11/06 23:05:18 UTC x86_64 x86_64 x86_64 GNU/Linux R version 2.8.0 Under development (unstable) (2008-07-07 r46046) We've see

[Rd] Recent snapshot tarballs of R-devel don't compile

2008-12-03 Thread hpages
Hi, Trying to compile one of the latest snapshot tarballs of R-devel gives me the following error (64-bit openSUSE 10.3): ... make[2]: Entering directory `/loc/home/biocbuild/bbs-2.4-bioc/R/src/library/Recommended' make[2]: *** No rule to make target `VR.ts', needed by `stamp-recommende

Re: [Rd] Multiplication (PR#8466)

2006-01-06 Thread hpages
Thomas Lumley wrote: >On Fri, 6 Jan 2006, [EMAIL PROTECTED] wrote: > > > >>hi - in version 2.1 the command >> >> >> >>>-2^2 >>> >>> >>gives >> >>-4 >> >>as the answer. (-2)^2 is evaluated correctly. >> >> > >So is -2^2. The precedence of ^ is higher than that of unary minus. It