similar to: [R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.

Displaying 20 results from an estimated 2000 matches similar to: "[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package."

2019 May 14
2
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
On Tue, 14 May 2019 at 12:31, Pavel Krivitsky <pavel at uow.edu.au> wrote: > > > Note that disabling name-based dispatch implies two things: 1) the > > inability to override your method by defining gen.formula in the > > global environment, and 2) another package can break yours (i.e., > > internal calls to gen()) by registering an S3 method for gen() after >
2019 May 14
0
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
Hi, I?aki, Thanks for looking into this. On Tue, 2019-05-14 at 11:33 +0200, I?aki Ucar wrote: > > So, calling the same generic function with the same class results > > in different dispatching behaviour depending on whether the call is > > from within the package doing the export or from the outside. > > It does not depend on whether you export gen.formula() or not. When
2019 May 19
2
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
On Sat, 18 May 2019 at 23:34, Pavel Krivitsky <pavel at uow.edu.au> wrote: > > > The issue here is that you are registering a non-standard name > > (.gen.formula) for that generic and then defining what would be the > > standard name (gen.formula) for... what purpose? IMHO, this is a bad > > practice and should be avoided. > > The situation initially arose
2019 May 18
0
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
Hi, Inaki, On Tue, 2019-05-14 at 12:50 +0200, I?aki Ucar wrote: > The thing is that, in R, "nearer" means "the calling environment" > (and then, other things). When you call test_me(), the calling > environment for gen() is the package namespace. When you call gen() > directly, thenthe calling environment is the global environment. So > what happens here follows
2019 May 19
0
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
Hi, Inaki, On Sun, 2019-05-19 at 16:59 +0200, I?aki Ucar wrote: > IMO the simplest way to do this is to check who the caller was: > > foo <- function(x) UseMethod("foo") > foo.bar <- function(x) { > sc <- sys.call(-1) > if (is.null(sc) || sc[[1]] != "foo") > .Deprecated(msg="Calling 'foo.bar' directly is deprecated")
2010 Feb 14
1
How S3method() is implemented and called? And when to use it?
R-exts.pdf discribes S3method a little bit. But I want to understand more on how it is called, implemented and when to use it. I don't find it in an R session. But I see S3method() in some NAMESPACE files. > S3method Error: object 'S3method' not found > ?S3method No documentation for 'S3method' in specified packages and libraries: you could try '??S3method' I
2007 Nov 05
2
namespace crash on S3method("as.ff",function)
Dear all, I have defined a generic as.ff(x, ...) and a method as.ff.function(x, ...) which converts a standard R function x into a chunked version operating on large ff objects. Everything works fine, but when registering S3method("as.ff",function) in NAMESPACE, the installation fails with some kind of parsing error: adding build stamp to DESCRIPTION installing NAMESPACE file
2017 Jul 06
4
Regarding R_LIBS_USER
Hello, I just subscribed to the list to join the discussion after being blindsided by the change and reading Dirk Eddelbuettel's reply to my bug report at https://bugs.debian.org/866768 . As far as I can tell the advantages of site library are: 1. Saves disk space and a little bit of user time spent installing and upgrading. 2. Other Debian package manages, like pip, default?to
2013 Apr 24
1
Problem with S3 method dispatch and NAMESPACE
I have updated the rms package to extensively use NAMESPACE. I cannot get certain S3 methods to dispatch. For example I have in NAMESPACE S3method(anova, rms) S3method(latex, anova.rms) anova.rms produces an object of class "anova.rms" and there is a latex.anova.rms function in rms. But when I do latex(anova(fit)) I get an invocation of latex.default. I have tried using
2012 Nov 02
1
Can't install.packages() from local repo in 2.15.2
Hi guys I think there's a high chance this is a bug. But I can't rule out that I can be blamed for this. I've posted this to bugzilla (#15092). Then I read that I probably should have posted it to R-develop first. Sorry for doing this in the wrong order. I've set up a local repo on my local drive (happens to be mapped to L:/). It has the following structure (as per
2009 May 27
1
"Error: package/namespace load failed"
I am writing my first R package, and I have been getting the following series of errors when I run R CMD check: * checking S3 generic/method consistency ... WARNING Error: package/namespace load failed for 'REEMtree' Call sequence: 2: stop(gettextf("package/namespace load failed for '%s'", libraryPkgName(package)), call. = FALSE, domain = NA) 1: library(package,
2019 Jun 11
5
[nbdkit PATCH v2] Introduce cacheextents filter
This filter caches the last result of the extents() call and offers a nice speed-up for clients that only support req_one=1 in combination with plugins like vddk, which has no overhead for returning information for multiple extents in one call, but that call is very time-consuming. Quick test showed that on a fast connection and a sparsely allocated 16G disk with a OS installed `qemu-img map`
2015 Jul 07
3
List S3 methods and defining packages
Hi, from the man page ?methods, I expected to be able to build pairs (class,package) for a given S3 method, e.g., print, using attr(methods(print), 'info'). However all the methods, except the ones defined in base or S4 methods, get the 'from' value "registered S3method for print", instead of the actual package name (see below for the first rows). Is this normal
2010 Nov 30
1
warning creating an as.array method in a package
[Env: R 2.11.1, Win Xp, using Eclipse/StatET] In a package I'm working on, I want to create as.matrix() and as.array() methods for a particular kind of object (log odds ratios). These are returned in a loddsratio object as the $coefficients component, a vector, but really reflect an underlying (R-1)x(C-1)xstrata array, whose attributes are contained in other components. I define coef,
2004 Oct 17
2
Errors while compiling packages with namespace?
Hello, I try to set up namespaces for packages. It is fine for several of them, except one whose compilation fails (under Windows XP & R 2.0.0): ---------- Making package svViews ------------ adding build stamp to DESCRIPTION installing NAMESPACE file and metadata Error in parse(file, n, text, prompt) : syntax error on line 21 Execution halted make[2]: *** [nmspace] Error 1 make[1]: ***
2013 Apr 19
2
NAMESPACE and imports
I am cleaning up the rms package to not export functions not to be called directly by users. rms uses generic functions defined in other packages. For example there is a latex method in the Hmisc package, and rms has a latex method for objects of class "anova.rms" so there are anova.rms and latex.anova.rms functions in rms. I use:
2010 Dec 09
1
warning creating an as.array method in a package
I posted on this topic to r-help, but never got a sufficient answer, so I'm reposting here. [Env: R 2.11.1, Win Xp, using Eclipse/StatET] In a package I'm working on, I want to create as.matrix() and as.array() methods for a particular kind of object (log odds ratios). These are returned in a loddsratio object as the $coefficients component, a vector, but really reflect an underlying
2006 Sep 01
1
as.environment(NULL)
Hi In NEWS, it says R CMD check now tests that the package can be loaded, and that the package and namespace (if there is one) can each be loaded in startup code (before the standard packages are loaded). For package "onion", I think I have followed all of sections 1.6.1 - 1.6.6 of R-exts, and it passes R CMD check for R-2.3.1. However, using R version 2.4.0 Under
2020 Feb 18
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
I am trying to create a class union of class unions to facilitate method dispatch. When I execute code in the global environment, everything acts as expected, however when I put the same code in the context of a package, selectMethod can no longer find the correct method. This first block below puts the code in the context of a package: fn <- "codefile.R" writeLines( c(
2012 Feb 13
1
Overwrite S3 methond from base package
Dear all, I am developing a package, which bundles my most frequently used functions. One of those is a modified version of droplevels from the base package (basically, it preserves any contrast function which was used to create the factor, contrast matrices are not kept, for they could be wrong if a level is dropped). In my NAMESPACE file I've the following directives, which should export