similar to: Argument 'dim' misspelled in error message

Displaying 20 results from an estimated 2000 matches similar to: "Argument 'dim' misspelled in error message"

2017 May 15
4
stopifnot() does not stop at first non-TRUE argument
This is getting pretty convoluted. The current behavior is consistent with the description at the top of the help page -- it does not promise to stop evaluation once the first non-TRUE is found. That seems OK to me -- if you want sequencing you can use stopifnot(A) stopifnot(B) or stopifnot(A && B) I could see an argument for a change that in the multiple argumetn case reports _all_
2017 Jun 06
1
surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)
I've fixed this and will commit soon. Disregard my dim<-() example; that behaves as expected (the class needs a dim<-() method). Michael On Tue, Jun 6, 2017 at 5:16 AM, Michael Lawrence <michafla at gene.com> wrote: > Thanks for the report. The issue is that one cannot set special attributes > like names, dim, dimnames, etc on S4 objects. I was aready working on this >
2017 Jun 06
2
surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)
Hi, It's nice to be able to define S4 classes with slots that correspond to standard attributes: setClass("A1", slots=c(names="character")) setClass("A2", slots=c(dim="integer")) setClass("A3", slots=c(dimnames="list")) By doing this, one gets a few methods for free: a1 <- new("A1", names=letters[1:3])
2019 Mar 22
2
selectMethod() can fail to find methods in situations of multiple dispatch
Fine with me as long as eliminating the inconveniences associated with it can be put on the roadmap. The alias instability and the fact that the user has no way to know if s/he should do ?`foo,numeric-method` or ?`foo,numeric,ANY-method` to find the method has been a long-standing problem. H. On 3/21/19 21:29, Michael Lawrence wrote: If we started over, I'd try to avoid this sort of
2018 Jun 08
2
Subsetting the "ROW"s of an object
I suspect this will have suboptimal performance since the TRUEs will get recycled. (Maybe there is, or could be, ALTREP, support for recycling) Hadley On Fri, Jun 8, 2018 at 10:16 AM, Berry, Charles <ccberry at ucsd.edu> wrote: > > >> On Jun 8, 2018, at 8:45 AM, Hadley Wickham <h.wickham at gmail.com> wrote: >> >> Hi all, >> >> Is there a better to
2017 May 16
2
stopifnot() does not stop at first non-TRUE argument
>>>>> Herv? Pag?s <hpages at fredhutch.org> >>>>> on Mon, 15 May 2017 16:54:46 -0700 writes: > Hi, > On 05/15/2017 10:41 AM, luke-tierney at uiowa.edu wrote: >> This is getting pretty convoluted. >> >> The current behavior is consistent with the description at the top of >> the help page -- it does not
2018 Jun 08
4
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 11:52 AM, Hadley Wickham <h.wickham at gmail.com> wrote: > > On Fri, Jun 8, 2018 at 11:38 AM, Berry, Charles <ccberry at ucsd.edu> wrote: >> >> >>> On Jun 8, 2018, at 10:37 AM, Herv? Pag?s <hpages at fredhutch.org> wrote: >>> >>> Also the TRUEs cause problems if some dimensions are 0: >>>
2015 Sep 29
3
making object.size() more meaningful on environments?
Hi, Currently object.size() is not very useful on environments as it always returns 56 bytes, no matter how big the environment is: env1 <- new.env() object.size(env1) # 56 bytes env2 <- new.env(hash=TRUE, size=75000000L) object.size(env2) # 56 bytes env3 <- list2env(list(a=runif(25000000), L=LETTERS)) object.size(env3) # 56 bytes This makes it pretty useless on
2017 Nov 29
2
binary form of is() contradicts its unary form
Hi Mehmet, On 11/29/2017 11:22 AM, Suzen, Mehmet wrote: > Hi Herve, > > I think you are confusing subclasses and classes. There is no > contradiction. `is` documentation > is very clear: > > `With one argument, returns all the super-classes of this object's class.` Yes that's indeed very clear. So if "list" is a super-class of "data.frame" (as
2019 Mar 22
2
selectMethod() can fail to find methods in situations of multiple dispatch
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 the form \alias{foo,numeric-method} when a method without the ANY suffix in its signature gets added to the ecosystem. See my post about this to the Bioc-devel mailing list a couple of months ago:
2017 May 03
2
stopifnot() does not stop at first non-TRUE argument
Not sure why the performance penalty of nonstandard evaluation would be more of a concern here than for something like switch(). If that can't/won't be fixed, what about fixing the man page so it's in sync with the current behavior? Thanks, H. On 05/03/2017 02:26 AM, peter dalgaard wrote: > The first line of stopifnot is > > n <- length(ll <- list(...)) > >
2015 Jan 06
4
setequal: better readability, reduced memory footprint, and minor speedup
Hi, Current implementation: setequal <- function (x, y) { x <- as.vector(x) y <- as.vector(y) all(c(match(x, y, 0L) > 0L, match(y, x, 0L) > 0L)) } First what about replacing 'match(x, y, 0L) > 0L' and 'match(y, x, 0L) > 0L' with 'x %in% y' and 'y %in% x', respectively. They're strictly equivalent but the latter
2018 Jan 30
2
as.list method for by Objects
by() does not always return a list. In Gabe's example, it returns an integer, thus it is coerced to a list. as.list() means that it should be a VECSXP, not necessarily with "list" in the class attribute. Michael On Tue, Jan 30, 2018 at 2:41 PM, Herv? Pag?s <hpages at fredhutch.org> wrote: > Hi Gabe, > > Interestingly the behavior of as.list() on by objects seem to
2017 Nov 29
2
binary form of is() contradicts its unary form
Hi, The unary forms of is() and extends() report that data.frame extends list, oldClass, and vector: > is(data.frame()) [1] "data.frame" "list" "oldClass" "vector" > extends("data.frame") [1] "data.frame" "list" "oldClass" "vector" However, the binary form of is()
2018 Jun 08
1
Subsetting the "ROW"s of an object
On 06/08/2018 10:15 AM, Michael Lawrence wrote: > There probably should be an abstraction for this. In S4Vectors, we > have extractROWS(). FWIW the code in S4Vectors that does what your subset_ROW() does is: https://github.com/Bioconductor/S4Vectors/blob/04cc9516af986b30445e99fd1337f13321b7b4f6/R/subsetting-utils.R#L466-L476 (This is the default "extractROWS" method.) Except
2017 May 03
2
stopifnot() does not stop at first non-TRUE argument
Hi, It's surprising that stopifnot() keeps evaluating its arguments after it reaches the first one that is not TRUE: > stopifnot(3 == 5, as.integer(2^32), a <- 12) Error: 3 == 5 is not TRUE In addition: Warning message: In stopifnot(3 == 5, as.integer(2^32), a <- 12) : NAs introduced by coercion to integer range > a [1] 12 The details section in its man
2016 Mar 19
2
unary class union of an S3 class
On 03/19/2016 01:22 AM, Michael Lawrence wrote: > > > On Sat, Mar 19, 2016 at 12:10 AM, Herv? Pag?s <hpages at fredhutch.org > <mailto:hpages at fredhutch.org>> wrote: > > On 03/18/2016 03:28 PM, Michael Lawrence wrote: > > > On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s > <hpages at fredhutch.org <mailto:hpages at
2019 Mar 14
2
selectMethod() can fail to find methods in situations of multiple dispatch
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#ANY method >
2018 May 16
2
Dispatch mechanism seems to alter object before calling method on it
Hi, This was quite unexpected: setGeneric("foo", function(x) standardGeneric("foo")) setMethod("foo", "vector", identity) foo(matrix(1:12, ncol=3)) # [1] 1 2 3 4 5 6 7 8 9 10 11 12 foo(array(1:24, 4:2)) # [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 If I define a method for array objects,
2018 May 16
2
Dispatch mechanism seems to alter object before calling method on it
On 05/15/2018 09:13 PM, Michael Lawrence wrote: > My understanding is that array (or any other structure) does not > "simply" inherit from vector, because structures are not vectors in > the strictest sense. Basically, once a vector gains attributes, it is > a structure, not a vector. The methods package accommodates this by > defining an "is" relationship