Re: [Rd] Namespace/inheritance problem in S4 methods for a union class

2013-05-08 Thread Renaud Gaujoux
I obviously cannot predict the implications as much as John, but would the followings be solutions: - setClassUnion looks up for subclasses of its elements and add them up, and setClass('A', ...) would update the union classes of any superclass of 'A'. removeClass would need to do some cleanup, wh

[Rd] subsetting by name is very slow when subscript contains a lot of "invalid" names

2013-05-08 Thread Hervé Pagès
Hi, Note sure why but subsetting by name is *very* slow when the character vector used as subscript contains a lot of "invalid" names: x <- c(A=10L, B=20L, C=30L) subscript <- c(LETTERS[1:3], sprintf("ID%05d", 1:15)) > system.time(y1 <- x[subscript]) user system elapsed 111.99

Re: [Rd] Dependencies of Imports not attached?

2013-05-08 Thread Simon Urbanek
On May 8, 2013, at 1:52 PM, Martin Morgan wrote: > On 05/08/2013 10:25 AM, Simon Urbanek wrote: >> >> On May 7, 2013, at 11:35 PM, Peter Meilstrup wrote: >> >>> Encountered an error in scripting, which can be reproduced using Rscript as >>> follows: >>> >>> $ Rscript -e "library(httr); handle('

Re: [Rd] getting corrupted data when using readBin() after seek() on a gzfile connection

2013-05-08 Thread Henrik Bengtsson
I can reproduce this (exactly the same output) on Windows: > sessionInfo() R version 3.0.0 Patched (2013-04-29 r62694) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4]

Re: [Rd] Dependencies of Imports not attached?

2013-05-08 Thread Martin Morgan
On 05/08/2013 10:25 AM, Simon Urbanek wrote: On May 7, 2013, at 11:35 PM, Peter Meilstrup wrote: Encountered an error in scripting, which can be reproduced using Rscript as follows: $ Rscript -e "library(httr); handle('http://cran.r-project.org')" Error in getCurlHandle(cookiefile = cookie_p

Re: [Rd] Dependencies of Imports not attached?

2013-05-08 Thread Simon Urbanek
On May 7, 2013, at 11:35 PM, Peter Meilstrup wrote: > Encountered an error in scripting, which can be reproduced using Rscript as > follows: > > $ Rscript -e "library(httr); handle('http://cran.r-project.org')" > > Error in getCurlHandle(cookiefile = cookie_path, .defaults = list()) : > could

Re: [Rd] Namespace/inheritance problem in S4 methods for a union class

2013-05-08 Thread John Chambers
No need for generic functions and methods. Just looking at the hierarchy of the classes shows the problem. With Martin's simplified version: > library(PkgA) > extends("A") [1] "A" > library(PkgB) > extends("B") [1] "B" "A" > setClassUnion("C", c("matrix", "A")) > extends("A") [1] "A" "C" > ext

[Rd] getting corrupted data when using readBin() after seek() on a gzfile connection

2013-05-08 Thread Hervé Pagès
Hi, I'm running into more issues when reading data from a gzfile connection. If I read the data sequentially with successive calls to readBin(), the data I get looks ok. But if I call seek() between the successive calls to readBin(), I get corrupted data. Here is a (hopefully) reproducible examp