On 22/06/2020 10:17 p.m., Bert Gunter wrote:
"Users don't get warned about overriding names in packages they've
loaded, because that would just be irritating."
Is that also true if the package or generic is imported by another that
they load; or is a dependency of a package they load? If so, I
"Users don't get warned about overriding names in packages they've
loaded, because that would just be irritating."
Is that also true if the package or generic is imported by another that
they load; or is a dependency of a package they load? If so, I would not
call it "just irritating" because if s
Hi Duncan: I maintain dynlm and your example is the exact reason I've been
getting emails from people regarding
it not working correctly. I've been telling them to load dplyr by using
library(dplyr, exclude = c("filter", "lag"))
On Mon, Jun 22, 2020 at 7:57 PM Duncan Murdoch
wrote:
> On 22/
On 22/06/2020 3:48 p.m., Tom Wainwright wrote:
Yet another alternative is simply to prevent your second package from
overriding the previously defined generic. The basic problem is the ease
with which R allows overriding prior generic definitions (one of those bits
of bad behavior we in the USA u
Yet another alternative is simply to prevent your second package from
overriding the previously defined generic. The basic problem is the ease
with which R allows overriding prior generic definitions (one of those bits
of bad behavior we in the USA used to call "a Bozo No-No"), which hides all
the
Another decent alternative is to submit the generic function to the
`generics` package - https://github.com/r-lib/generics - or create
your own API package.
Both package A and B can import the generic from it, and everything
works fine. It may also reduce your dependencies and/or build time.
This
On 22/06/2020 1:40 p.m., Bert Gunter wrote:
...
and just to add to the query, assume the author of pkg B did (does) not
know of pkg A and so, for example, could (did) not import any of pkg A's
content into B. Given that there are at the moment ~20,000 packages out
there, this does not seem to be
...
and just to add to the query, assume the author of pkg B did (does) not
know of pkg A and so, for example, could (did) not import any of pkg A's
content into B. Given that there are at the moment ~20,000 packages out
there, this does not seem to be an unreasonable assumption. One may even
furth
On 22/06/2020 1:00 p.m., Viechtbauer, Wolfgang (SP) wrote:
Hi All,
Let's say there are two packages pkgA and pkgB, both of which have a generic
function
foo <- function(x, ...)
UseMethod("foo")
and pkgA has a method for objects of class "A":
foo.A <- function(x, ...)
print(x)
and pk
Hi All,
Let's say there are two packages pkgA and pkgB, both of which have a generic
function
foo <- function(x, ...)
UseMethod("foo")
and pkgA has a method for objects of class "A":
foo.A <- function(x, ...)
print(x)
and pkgB has a method for objects of class "B":
foo.B <- function(x,
10 matches
Mail list logo