Re: [Rd] [External] Re: Change to I() in R 4.1

2020-10-30 Thread Pages, Herve
On 10/30/20 10:48, luke-tier...@uiowa.edu wrote: > On Fri, 30 Oct 2020, Pages, Herve wrote: > >> >> On 10/29/20 23:08, Pages, Herve wrote: >> ... >>> >>> I can think of 2 ways to move forward: >>> >>> 1. Keep I()'s current impl

Re: [Rd] Change to I() in R 4.1

2020-10-30 Thread Pages, Herve
On 10/29/20 23:08, Pages, Herve wrote: ... > > I can think of 2 ways to move forward: > > 1. Keep I()'s current implementation but suppress the warning. We'll > make the necessary adjustments to DataFrame() to repair columns supplied > as I() objects. Note t

Re: [Rd] Change to I() in R 4.1

2020-10-29 Thread Pages, Herve
Hi Martin, On 10/26/20 04:52, Martin Maechler wrote: >> >> Hi there, >> Is that change in R-devel intentional? >> >> library(Matrix) >> m <- as(matrix(c(0, 1)), "sparseMatrix") >> >> isS4(m) >> # [1] TRUE >> >> x <- I(m) >> # Warning message: >> # In `class<-`(x, unique

[Rd] Change to I() in R 4.1

2020-10-23 Thread Pages, Herve
Hi there, Is that change in R-devel intentional? library(Matrix) m <- as(matrix(c(0, 1)), "sparseMatrix") isS4(m) # [1] TRUE x <- I(m) # Warning message: # In `class<-`(x, unique.default(c("AsIs", oldClass(x : # Setting class(x) to multiple strings ("AsIs", "dgCMat

Re: [Rd] sum() (and similar methods) should work for zero row data.frames

2020-10-23 Thread Pages, Herve
Hi, There are 2 bugs here. The proposed fix to Summary.data.frame() is fine but it doesn't address the other problem reported by the OP that as.matrix() on a zero-row data.frame doesn't respect the type of its columns, like other column-combining operations do: df <- data.frame(a=numeric(0)

[Rd] inaccurate description of 'init' argument in ?Reduce

2020-09-30 Thread Pages, Herve
Hello list, In ?Reduce: init: an R object of the same kind as the elements of ‘x’. Seems like "the same kind" is an unnecessary and artificial restriction. Furthermore, there is no notion of "same kind" for heterogeneous lists: x <- list(letters, c(TRUE, FALSE)) Reduce(function(init

Re: [Rd] class() |--> c("matrix", "arrary") -- and S3 dispatch

2020-01-29 Thread Pages, Herve
On 1/27/20 23:51, Martin Maechler wrote: >>>>>> Pages, Herve >>>>>> on Tue, 21 Jan 2020 17:33:01 + writes: > > > Dear Martin, > > What's the ETA for _R_CLASS_MATRIX_ARRAY_=TRUE to become the new > > unconditio

Re: [Rd] R package builder silently continues after unclosed brace

2020-01-25 Thread Pages, Herve
On 1/25/20 12:55, Gábor Csárdi wrote: > R CMD build does not actually run any R code, **unless** the package contains dynamic vignettes and/or dynamic man pages (e.g. man pages that include \Sexpr macros), in which case 'R CMD build' first installs the package in order to evaluate the dynamic st

Re: [Rd] class() |--> c("matrix", "arrary") -- and S3 dispatch

2020-01-21 Thread Pages, Herve
t: a matrix is an array > 2) Your package (or one you use) may be affected. > > >>>>>> Martin Maechler >>>>>> on Fri, 15 Nov 2019 17:31:15 +0100 writes: > >>>>>> Pages, Herve >>>>>> on Thu, 14 N

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Pages, Herve
On 1/9/20 06:56, Stepan wrote: > On 09. 01. 20 15:41, lille stor wrote: > >> I believe this could be done without creating side effects (e.g. >> crash) as we are just talking about changing values. A crash would certainly be an annoying "side effect" ;-) As Stepan explained, data.frame objects

Re: [Rd] Another wish (?) for R 4.0.0: print(*, width = )

2020-01-07 Thread Pages, Herve
On 1/7/20 06:13, brodie gaslam via R-devel wrote: ... > Happy new decade. *** caught segfault *** conflicting decade boundaries Traceback: 1: new_decade <- 2020:2029 2: previous_decade <- 2011:2020 3: previous_previous_decade <- 2001:2010 4: current_millenium <- 2001:3000 5: previous_

Re: [Rd] New R function is.nana = is.na & !is.nan

2020-01-01 Thread Pages, Herve
Happy New Year everybody! The name (is.nana) doesn't make much sense to me. Can you explain it? One alternative would be to add an extra argument (e.g. 'strict') to is.na(). FALSE by default, and ignored (with or w/o a warning) when the type of 'x' is not "numeric". H. On 12/31/19 22:16, Jan

Re: [Rd] A weird behaviour of strsplit?

2019-12-18 Thread Pages, Herve
The fact that strsplit() doesn't say anything about 'split' being longer than 'x' adds to the confusion: > strsplit(c("xAy", "xxByB", "xCyCCz"), split=c("A", "B", "C", "D")) [[1]] [1] "x" "y" [[2]] [1] "xx" "y" [[3]] [1] "x" "y" "" "z" A warning (or error) would go a long

Re: [Rd] class() |--> c("matrix", "arrary") [was "head.matrix ..."]

2019-11-14 Thread Pages, Herve
On 11/14/19 05:47, Hadley Wickham wrote: > On Sun, Nov 10, 2019 at 2:37 AM Martin Maechler > wrote: >> >>> Gabriel Becker >>> on Sat, 2 Nov 2019 12:37:08 -0700 writes: >> >> > I agree that we can be careful and narrow and still see a >> > nice improvement in behavior. Whil

Re: [Rd] class() |--> c("matrix", "arrary") [was "head.matrix ..."]

2019-11-13 Thread Pages, Herve
On 11/12/19 14:03, Abby Spurdle wrote: >> You can have your own rant about "user-defined binary operators being >> over-used within the R community" without suggesting that my rant was >> rude. > > I wasn't suggesting that you were rude. > I was questioning a trend. ok, well, I must ave misinterp

Re: [Rd] class() |--> c("matrix", "arrary") [was "head.matrix ..."]

2019-11-12 Thread Pages, Herve
On 11/12/19 12:21, Abby Spurdle wrote: > > >> x %inherits% "data.frame" > > IMHO, I think that user-defined binary operators are being over-used > within the R community. > > I don't think that they're "cute" or stylish. > I think their use should be limited to cases, where they significant

Re: [Rd] class() |--> c("matrix", "arrary") [was "head.matrix ..."]

2019-11-11 Thread Pages, Herve
On 11/11/19 01:40, Martin Maechler wrote: >> Duncan Murdoch >> on Sun, 10 Nov 2019 11:48:26 -0500 writes: > > > On 10/11/2019 9:17 a.m., Bryan Hanson wrote: > >> > >> > >>> On Nov 10, 2019, at 3:36 AM, Martin Maechler > wrote: > >>> > Gabriel

Re: [Rd] improving the performance of install.packages

2019-11-08 Thread Pages, Herve
stall.packages() internally, and so on. > > /Henrik > > PS. Although the idea of having update.packages() install missing > packages is not bad, I don't think I'm a not a fan for the sole > purpose of risking installation instructions starting using > update.packages()

Re: [Rd] improving the performance of install.packages

2019-11-08 Thread Pages, Herve
Actually there is one gotcha here: even if a package has not changed (i.e. same exact hash), there are situations where you want to reinstall it because one package it depends on has changed. This is because some of the stuff that gets cached at installation time (e.g. method table) can become

Re: [Rd] improving the performance of install.packages

2019-11-08 Thread Pages, Herve
Hi Gabe, Keeping track of where a package was installed from would be a nice feature. However it wouldn't be as reliable as comparing hashes to decide whether a package needs re-installation or not. H. On 11/8/19 12:37, Gabriel Becker wrote: > Hi Josh, > > There are a few issues I can think o

Re: [Rd] improving the performance of install.packages

2019-11-08 Thread Pages, Herve
Since we are on this topic, another area of improvement is when install.packages() downloads hundreds of packages only to realize later that many of them actually fail to install because one of the packages they depend on (directly or indirectly) failed to install. Cheers, H. On 11/8/19 11:55

Re: [Rd] improving the performance of install.packages

2019-11-08 Thread Pages, Herve
I guess you would just use force=TRUE H. On 11/8/19 12:06, William Dunlap via R-devel wrote: > While developing a package, I often run install.packages() on it many times > in a session without updating its version number. How would your proposed > change affect this workflow? > Bill Dunlap > TI

Re: [Rd] Puzzled about a new method for "[".

2019-11-04 Thread Pages, Herve
On 11/4/19 13:54, Duncan Murdoch wrote: > On 04/11/2019 4:40 p.m., Pages, Herve wrote: >> Hi Rolf, >> >> On 11/4/19 12:28, Rolf Turner wrote: >>> >>> On 5/11/19 3:41 AM, Hadley Wickham wrote: >>> >>>> For what it's worth, I do

Re: [Rd] Puzzled about a new method for "[".

2019-11-04 Thread Pages, Herve
Hi Rolf, On 11/4/19 12:28, Rolf Turner wrote: > > On 5/11/19 3:41 AM, Hadley Wickham wrote: > >> For what it's worth, I don't think this strategy can work in general, >> because a class might have attributes that depend on its data/contents >> (e.g. >> https://urldefense.proofpoint.com/v2/url?u

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-10-31 Thread Pages, Herve
On 10/30/19 04:29, Martin Maechler wrote: >> Gabriel Becker >> on Tue, 29 Oct 2019 12:43:15 -0700 writes: > > > Hi all, > > So I've started working on this and I ran into something that I didn't > > know, namely that for x a multi-dimensional (2+) array, head(x) and >

Re: [Rd] New matrix function

2019-10-11 Thread Pages, Herve
Has someone looked into the image processing area for this? That sounds a little bit too high-level for base R to me (and I would be surprised if any mainstream programming language had this kind of functionality built-in). H. On 10/11/19 03:44, Morgan Morgan wrote: > Hi All, > > I was lookin

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-09-16 Thread Pages, Herve
Hi, Alternatively, how about a new glance() generic that would do something like this: > library(DelayedArray) > glance <- DelayedArray:::show_compact_array > M <- matrix(rnorm(1e6), nrow = 1000L, ncol = 2000L) > glance(M) <1000 x 2000> matrix object of type "double": [,1]

Re: [Rd] class() bug when used within a validity method

2019-08-19 Thread Pages, Herve
On 8/19/19 16:23, Pages, Herve wrote: ... > Note that this doesn't happen if A is defined as a VIRTUAL class. To be precise, when A is a VIRTUAL class, it requires at least one additional level of class extension to break class(): setClass("A", contains="VIRTU

[Rd] class() bug when used within a validity method

2019-08-19 Thread Pages, Herve
Hi, This is a long-standing bug where 'class(object)' does not return the actual class of 'object' when used inside a validity method. Instead it seems to return the class for which the validity method is defined. For example: setClass("A", slots=c(stuff="ANY")) setValidity("A", function(o

Re: [Rd] Format printing inside a matrix

2019-07-07 Thread Pages, Herve
On 7/7/19 17:41, Jialin Ma wrote: > Hi Abby, > > Thanks a lot for your paraphrasing and your suggestion! > > The problem of wrapping the list into a S3/S4 object, i.e. subclassing array > or matrix, is that one also has to define a bunch of methods for subsetting, > joining, etc, in order to make

Re: [Rd] R pkg install should fail for unsuccessful DLL copy on windows?

2019-06-04 Thread Pages, Herve
On 5/31/19 08:41, Toby Hocking wrote:... > In my opinion install.packages should stop with an error (instead of a > warning) if this happens. Totally agree with that. Best, H. -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Cen

Re: [Rd] R pkg install should fail for unsuccessful DLL copy on windows?

2019-05-30 Thread Pages, Herve
Also note that this can lead to people not being able to load the package if the set of .Call entry points has changed between the old and new versions of the package. We strongly suspect that this is what happened to this Bioconductor user: https://support.bioconductor.org/p/121228/ Note that

Re: [Rd] nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)

2019-05-16 Thread Pages, Herve
On 5/16/19 17:48, Gabriel Becker wrote: Hi Herve, Inline. On Thu, May 16, 2019 at 4:45 PM Pages, Herve mailto:hpa...@fredhutch.org>> wrote: Hi Gabe, ncol(data.frame(aa=c("a", "b", "c"), AA=c("A", "B", "C"))) # [1] 2

Re: [Rd] nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)

2019-05-16 Thread Pages, Herve
Hi Gabe,   ncol(data.frame(aa=c("a", "b", "c"), AA=c("A", "B", "C")))   # [1] 2   ncol(data.frame(aa="a", AA="A"))   # [1] 2   ncol(data.frame(aa=character(0), AA=character(0)))   # [1] 2   ncol(cbind(aa=c("a", "b", "c"), AA=c("A", "B", "C")))   # [1] 2   ncol(cbind(aa="a", AA="A"))

Re: [Rd] update.package() asking even when asked to not ask

2019-04-25 Thread Pages, Herve
On 4/25/19 07:50, Tomas Kalibera wrote: > On 4/20/19 10:39 PM, Pages, Herve wrote: >> Hi, >> >> I was trying to update packages today on one of our MacOS servers, and >> got this: >> >>     > update.packages(ask=FALSE) >> >>       There i

Re: [Rd] Questions/suggestions about new staged installation

2019-04-25 Thread Pages, Herve
On 4/25/19 04:57, Tomas Kalibera wrote: > On 4/25/19 3:11 AM, Pages, Herve wrote: >> Hi, >> >> I was playing around with inotifywait (great tool!) to see the new >> staged installation of source packages in action. In one terminal I'm >> monitorin

[Rd] Questions/suggestions about new staged installation

2019-04-24 Thread Pages, Herve
Hi, I was playing around with inotifywait (great tool!) to see the new staged installation of source packages in action. In one terminal I'm monitoring the create/delete/move events of the installation library with:   inotifywait -m --timefmt '%F %T' --format '%T -- %w %e %f' -e create -e del

Re: [Rd] R CMD check does not report redundant '...' argument described in Rd File

2019-04-21 Thread Pages, Herve
Hi, FWIW I also noticed this problem and reported it on R’s Bugzilla 4 years ago: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16223 I actually had to report it twice because my first report (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16153) was closed after a few days and tag

[Rd] update.package() asking even when asked to not ask

2019-04-20 Thread Pages, Herve
Hi, I was trying to update packages today on one of our MacOS servers, and got this:   > update.packages(ask=FALSE)     There is a binary version available but the source version is later:    binary source needs_compilation   gsl 1.9-10.3  2.1-6  TRUE   Do you want to ins

Re: [Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-21 Thread Pages, Herve
trix", na.rm = "logical", dims = "numeric"’ But maybe it uses selectMethod() behind the seen so will work once selectMethod() gets fixed? Thanks, H. On 3/21/19 22:05, Michael Lawrence wrote: Agreed but I'm not sure we want users accessing documentation with thos

Re: [Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-21 Thread Pages, Herve
ure we want to mess with it. Michael On Thu, Mar 21, 2019 at 8:14 PM Pages, Herve mailto:hpa...@fredhutch.org>> wrote: Hi Michael, Thanks for looking into this. I suspect that truncation of ANY suffixes from method signatures is also the culprit behind the sudden breakage of aliases of th

Re: [Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-21 Thread Pages, Herve
ion of ANY suffixes from method signatures. I've hacked selectMethod() to be robust to that and will commit soon. Thanks for the report. Michael On Thu, Mar 14, 2019 at 9:32 AM Pages, Herve mailto:hpa...@fredhutch.org>> wrote: Here is an example: setGeneric("foo", func

[Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-14 Thread Pages, Herve
Here is an example: setGeneric("foo", function(x, y) standardGeneric("foo")) setMethod("foo", c("numeric", "ANY"), function(x, y) cat("I'm the foo#numeric#ANY method\n") ) Dispatch works as expected but selectMethod() fails to find the method: > foo(1, TRUE) I'm the foo#numeric#

[Rd] R CMD build now removes empty dirs

2011-03-30 Thread Pages, Herve
Hi, It's unfortunate that with recent revisions of R 2.13 (this appeared in revision 54640, March 2), 'R CMD build' now removes empty dirs in the package. People might have good reasons for having empty dirs in their packages. For example, in Bioconductor, we have some tools to automatically gener

[Rd] Namespace dependency not required

2011-03-24 Thread Pages, Herve
Hi, [hpages@localhost pkgreviews]$ R-2.13 CMD check qrqc_0.99.2.tar.gz * using log directory ‘/home/hpages/pkgreviews/qrqc.Rcheck’ * using R version 2.13.0 alpha (2011-03-24 r55004) * using platform: x86_64-unknown-linux-gnu (64-bit) * using session charset: UTF-8 * checking for file ‘