Displaying 20 results from an estimated 30000 matches similar to: "R CMD check thinks my function is an S3 method"
2019 Aug 05
1
R CMD check: should .Rout.save contain the new "Registered S3 method overwritten by" message?
Hi
Since I believe 3.6, there is a message when loading a package that
overwrites S3 methods, reading like "Registered S3 method overwritten
by...". Should this message be included in the xxx.Rout.save files saved in
the tests/ folder of a package? It seems R CMD check is not happy about it?
I simply ran R CMD BATCH xxx.R xxx.Rout.save but running later on R CMD
check on the package
2014 Jun 17
2
R CMD check warning with S3 method
I'm getting an R CMD check warning with a package (call it package A)
that defines an S3 method but not the generic. The generic is defined
in another package (package B). Package A imports the S3 generic from
B. And there's one additional detail: the generic overrides a function
in the stats package.
I've created a minimal test package which reproduces the problem:
2012 Apr 21
1
R CMD check -- non S3 method warning
I'm trying to R CMD check a package, and I'm getting the 'checking S3
generic/method consistency' warning.
I have written a function 'gamma.dist' which is _not_ an S3 method,
but happens to collide with the 'gamma' function from the R::base
namespace.
Is there a way of telling CMD check that the name is intentional and
is not meant to be an S3 method?
My function
2012 Nov 21
1
S3 generic/method consistency issue with R CMD check
Hi,
I'm having some trouble setting methods for the qr family of functions. I
believe I have distilled my misunderstanding in the code snippet below:
foo <- function(x, ...) UseMethod("foo")
foo.default <- function(x) { }
# foo
setGeneric(name = "foo", useAsDefault = foo)
setMethod("foo", signature(x="bar"),
function(x, ...) { }
)
2012 Sep 07
1
Need to tell R CMD check that a function qr.R is not a method
When creating a package, I would like a way to tell R that
a function with a period in its name is not a method.
I'm writing a package now with a modified version of qr.R.
R CMD check gives warnings:
* checking S3 generic/method consistency ... WARNING
qr:
function(x, ...)
qr.R:
function(qr, complete, pivot)
See section ‘Generic functions and methods’ of the ‘Writing R
Extensions’
2012 Mar 02
2
Correlation of huge matrix saved as binary file
Hi,
I have a 900,000,000*9,000 matrix where I need to calculate the correlation
between all entries along the smaller dimension, thus creating a 9k*9k
correlation matrix. This matrix is too big to be uploaded in R, and is saved
as a binary file. To access the data in the file I use mmap and some
api-functions (to get all values in one row, one column, or one particular
value). I'm looking for
2017 Sep 22
2
S4 method implementation for S3 class
2017-09-22 19:04 GMT+02:00 Michael Lawrence <lawrence.michael at gene.com>:
> The %*% function is a primitive. As it says in the documentation under
> ?Methods_Details
>
> Methods may be defined for most primitives, and corresponding
> metadata objects will be created to store them. Calls to the
> primitive still go directly to the C code, which will
2007 Nov 05
1
dot in function name taken as S3 method by package check
Hello everyone,
I'm trying to update the locfit package so that it passes package check
in R 2.6.0. However, the check seems to think some of the functions
with dot in the names are S3 methods (thus warns about the format of the
\usage{} part) when they are not. Can anyone recommend a workaround for
this? I tried reading R-exts, but couldn't find any hint. I'd very
much appreciate
2017 Sep 23
1
S4 method implementation for S3 class
> There is formally no such thing as an S3 class. Just S3 objects with a
> class attribute. You could extend a base class with an S4 class, like
> setClass("IntegerWithUnits", slots=c(units="Units"),
> contains="integer"). Sure, that's a disruptive change, but it would be
> in the right direction.
>
> Extending base classes is always a risky
2011 Feb 03
1
S3 method for S4 object
I am trying to extend an S3 method to work with an S4 object as well as the S3 objects it works with, but UseMethod does not seem to recognize the S4 class and dispatches to the default method. Is this to be expected or should I be looking for an error in my code?
If it is not an error in my code, is there an easy way to do this, or do I have to convert the generic to S4 and then make those
2013 Aug 24
2
Correct NAMESPACE approach when writing an S3 method for a generic in another package
Dear List,
In one of my packages I have an S3 method for the plot3d generic
function from package rgl. I am trying to streamline my Depends
entries but don't know how to have
plot3d(foo)
in the examples section for the plot3d method in my package, without
rgl being in Depends.
Note that I importFrom(rgl, plotd3d) and register my S3 method via
S3Method() in the NAMESPACE.
If rgl is not in
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
2017 Sep 22
2
S4 method implementation for S3 class
Hi all,
I'm trying to implement the matrix multiplication operator, which is
S4 generic, for an old-style S3 class. The following works as
expected:
x <- 1:10
class(x) <- "myClass"
setOldClass("myClass")
setGeneric("myMethod", function(x, y) standardGeneric("myMethod"))
setMethod("myMethod", c("myClass", "myClass"),
Could generic functions check different S3 methods for an object when one of them produces an error?
2019 Jun 17
1
Could generic functions check different S3 methods for an object when one of them produces an error?
Hi,
Let's say one has an object with multiple classes, and a generic function to apply to it has associated S3 methods for more than one of those classes. Further, the method it chooses (I do not know how; some order in the class vector?) is not the suitable one and it produces an error. Would there be some way to make the generic function to choice the correct method, or in case that for
2015 Mar 20
1
quieting the "apparent S3 methods" warning
Dear R-devel,
Recent versions of R CMD check have been flagging apparent S3 methods
that are not registered in the NAMESPACE as such. In most situations
this is very helpful. However, I have few cases in existing packages
where we have unfortunately named functions using a "." in them that
makes them appear as S3 methods when they are not.
As there is no existing class
2003 Jul 15
2
"na.action" parameter in princomp() (PR#3481)
Full_Name: Jerome Asselin
Version: 1.7.1
OS: Red Hat Linux 7.2
Submission from: (NULL) (24.77.125.119)
Setting the parameter na.action=na.omit should remove
incomplete records in princomp. However this does not
seem to work as expected. See example below.
Sincerely,
Jerome Asselin
data(USArrests)
princomp(USArrests, cor = TRUE) #THIS WORKS
USArrests[1,3] <- NA
princomp(USArrests, cor =
2006 Mar 15
1
Additional arguments in S3 method produces a warning
Hello,
I just notice this:
> x <- c(1:4,0:5, 4, 11)
> library(pastecs)
Loading required package: boot
> tp <- turnpoints(x)
> extract(tp, no.tp = FALSE, peak = TRUE, pit = FALSE)
[1] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
FALSE
Warning message:
arguments after the first two are ignored in: UseMethod("extract", e, n,
...)
>
2007 Oct 24
1
how to limit Amazon S3 access to my app's pages only (i.e. no hot-linking) ?
Hey there,
I want to stream my app''s media from Amazon S3. I''ve gotten the
basics down, having uploaded files, set their permissions for public
access, and now can use their S3 URLs wherever I need them.
My question is this: can I restrict access to my S3 files to only
within the context of the pages that my application serves? I want to
avoid people just looking at the
2003 Oct 04
2
mixed effects with nlme
Dear R users:
I have some difficulties analizing data with mixed effects NLME and the
last version of R. More concretely, I have a repeated measures design with
a single group and 2 experimental factors (say A and B) and my interest is
to compare additive and nonadditive models.
suj rv A B
1 s1 4 a1 b1
2 s1 5 a1 b2
3 s1 7 a1 b3
4 s1 1 a2
2009 Mar 17
1
exporting s3 and s4 methods
If a package defined an S3 generic and an S4 generic for the same function (so as to add methods for S4 classes to the existing code), how do I set up the namespace to have them exported?
With
import(stats)
exportMethods(bigglm)
importClassesFrom(DBI)
useDynLib(biglm)
export(biglm)
export(bigglm)
in NAMESPACE, the S3 generic is not exported.
> methods("bigglm")
[1] bigglm.RODBC*