> There may be cases when changing the class of the left-hand side make sense
> (such as one subclass of "Matrix" to another) but certainly not for the base
> R vector classes.
I'm not sure what you mean by "not for the base R vector classes".
Historically, the simpler class (or mode) gets coerc
020 03:03
To: Martin Maechler
Cc: Georgi Boshnakov ; r-devel@r-project.org
Subject: Re: [Rd] more Matrix weirdness
> > "These operators are also implicit S4 generics, but as
> > primitives, S4 methods will be dispatched only on S4
> > objects ‘x’."
> Yes, exac
8
To: Georgi Boshnakov
Cc: r-devel@r-project.org
Subject: Re: [Rd] more Matrix weirdness
>>>>> Georgi Boshnakov
>>>>> on Wed, 9 Sep 2020 10:48:56 + writes:
> I think that this is because `[<-` dispatches on S4
> methods only if the fir
> > "These operators are also implicit S4 generics, but as
> > primitives, S4 methods will be dispatched only on S4
> > objects ‘x’."
> Yes, exactly, very well found, Georgi!
I'm sorry Martin, but I don't understand your point here.
I'm assuming that you want the (S3) matrix, x, to
27;m happy if you create a formal bug report, possibly "wishlist"
as it is documented behavior, for this infelicity...
and then I will probably add the 'HELPWANTED' keyword.
Martin
> -Original Message-
> Message: 19 Date: Tue, 8 Sep 2020 22:04:44 -040
Message-
Message: 19
Date: Tue, 8 Sep 2020 22:04:44 -0400
From: Ben Bolker
To: r-devel
Subject: [Rd] more Matrix weirdness
Message-ID:
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Am I being too optimistic in expecting this (mixing and matching
matrice
Hello,
R 4.0.2 on Ubuntu 20.04, sessionInfo() below.
I can reproduce this, sort of. The error I'm getting is different:
x[rr, cc] <- m
#Error in x[rr, cc] <- m : replacement has length zero
But if I check lengths and dimensions, they are identical().
identical(length(x[rr, cc]), length(m))
#
Am I being too optimistic in expecting this (mixing and matching
matrices and Matrices) to work? If x is a matrix and m is a Matrix,
replacing a commensurately sized sub-matrix of x with m throws "number
of items to replace is not a multiple of replacement length" ...
x <- matrix(0,nrow=3,n