What about turning your S3 class into a R6 class. That way, the methods you
provide can be overridden easily by other developers by creating a class
that inherits from yours.
This is standard oop, as opposed to special R S3 oop.
Neonira
Le sam. 10 août 2019 à 21:11, Lenth, Russell V a
écrit :
l V
Cc: Duncan Murdoch ; Iñaki Ucar
; r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] [External] Re: Farming out methods to other packages
You could have your default method handle the cases you can handle; if you want
that to dispatch you can use something like
recover_data.default &l
On Sat, 10 Aug 2019 at 22:14, Tierney, Luke wrote:
>
> You could have your default method handle the cases you can handle; if
> you want that to dispatch you can use something like
>
> recover_data.default <- function(object, ...)
> default_recover_data(object, ...)
> default_recover_data <-
On Sat, 10 Aug 2019 at 21:11, Lenth, Russell V wrote:
>
> Thanks Iñaki,
>
> However...
>
> > 1) renaming those methods (e.g., recover_data_foo, because as soon as
> there is a something.foo
> > in your namespace, it will be dispatched regardless of whether you
> register it or not)
>
> I
Sent: Saturday, August 10, 2019 3:15 PM
To: Lenth, Russell V
Cc: Duncan Murdoch ; Iñaki Ucar
; r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] [External] Re: Farming out methods to other packages
You could have your default method handle the cases you can handle; if you want
that to d
; -Original Message-
> From: Duncan Murdoch
> Sent: Saturday, August 10, 2019 2:43 PM
> To: Lenth, Russell V ; Iñaki Ucar
>
> Cc: r-package-devel@r-project.org
> Subject: Re: [R-pkg-devel] [External] Re: Farming out methods to other
> packages
>
> On 10/08/2019 3:27
Ucar
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] [External] Re: Farming out methods to other packages
On 10/08/2019 3:27 p.m., Lenth, Russell V wrote:
> H, I thought of an approach -- a kind of manual dispatch
> technique. My generic is
>
> recover_data &
On 10/08/2019 3:27 p.m., Lenth, Russell V wrote:
H, I thought of an approach -- a kind of manual dispatch technique. My
generic is
recover_data <- function(object, ...) {
rd <- try(getS3method("recover_data", class(object)[1], envir =
.GlobalEnv, silent = TRUE))
if (!inherits(rd,
Thanks, Neonira. Always something new to learn!
Russ
From: neonira Arinoem
Sent: Saturday, August 10, 2019 2:22 PM
To: Lenth, Russell V
Cc: Iñaki Ucar ; r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] [External] Re: Farming out methods to other packages
What about turning your S3
H, I thought of an approach -- a kind of manual dispatch technique. My
generic is
recover_data <- function(object, ...) {
rd <- try(getS3method("recover_data", class(object)[1], envir = .GlobalEnv,
silent = TRUE))
if (!inherits(rd, "try-error"))
rd(object, ...)
else
Thanks Iñaki,
However...
> 1) renaming those methods (e.g., recover_data_foo, because as soon as
there is a something.foo
> in your namespace, it will be dispatched regardless of whether you
register it or not)
If I do that, then emmeans won't support foo objects until foopkg offers
11 matches
Mail list logo