Displaying 20 results from an estimated 10000 matches similar to: "S4-based package failure: setGeneric example#1"
2010 Apr 19
0
S4-based package failure: setGeneric example#1
I am a newbie package builder who successfully built a "Hello world" package
but am now having trouble building a package with S4 functionality. I
thought I would start by building a package consisting of just the first
example under the setGeneric help page in a "fresh" 2.10.0 (windows) console
(methods loaded at startup). The example:
## create a new generic function, with a
2008 Mar 30
1
package.skeleton.S4
Hi the devel list.
I am adapting the package.skeleton to S4 classes and methods
I would have been very proud to post a new working function on this list.
Unfortunately, I do not manage to solve all the problems. Mainly
- sys.source does not compile a file with setClass
- dumpMethod does not exists yet
In the following code, thise two problems are notified by a line
#################
Still
2013 Feb 02
1
setGeneric() gives "must supply skeleton" when checking package
r-devel,
In a development version of the CRAN package metrumrg, I write ...
require(reshape)
setGeneric('cast')
setOldClass(c('keyed','data.frame'))
setMethod('cast','keyed', function ...)
The result is satisfactory when sourcing the code directly, but when
checking the package (which has 'reshape' as a dependency in the
DESCRIPTION file) I get
2011 Aug 24
1
setMethods/setGeneric problem when R CMD CHECK'ing a package
R-helpers:
I'm trying to build a package, but I'm a bit new to the whole S3/S4
methods concept. I'm trying to add a new definition of the zoo
function "as.yearmon", but I'm getting the following error when it
gets to this point during a package install:
***
R CMD INSTALL STARStools
* installing to library
2012 Jun 09
2
Help getting Torchlight 2 Beta running (Mac)
Hey everybody, I'm VERY new at using Wine, so forgive me if this is a foolish question! Recently I've been trying to run the Torchlight 2 Beta under Wine? the game itself runs flawlessly, but in order to get it to run past the beta expiration date I have to run another application (I'm not entirely sure what it is, my belief is that it emulates a server of some sort to play on). No
2010 Feb 08
1
using setMethod or setGeneric to change S4 accessor symbol from @ to $
I created some S4 objects that are essentially data frame objects. The S4
object definitions were necessary to verify data integrity and force a
standardized data format. I am, however, finding myself redefining all the
typical generic functions so that I can still manipulate my S4 objects as if
they were data frames ... I have used setMethod to set methods for "subset",
2002 Sep 10
1
setGeneric(); R CMD check
1. Is it always the case that when defining generic functions in
a package, the package needs to be installed as a binary package
to avoid having the generic functions in the .GlobalEnv?
2. Defining a generic function in a "non-binary" package triggers
a check warning
$ R CMD check ...
...
* checking for code/documentation mismatches ... WARNING
Objects
2009 Dec 17
5
?setGeneric garbled (PR#14153)
Full_Name: Ross Boylan
Version: 2.10.0
OS: Windows XP
Submission from: (NULL) (198.144.201.14)
Some of the help for setGeneric seems to have been garbled. In the section
"Basic Use", 5th paragraph (where the example counts as a single line 3rd
paragraph) it says
<quote>
Note that calling 'setGeneric()' in this form is not strictly
necessary before calling
2010 Jan 19
1
calling setGeneric() twice
Is it safe to call setGeneric twice, assuming some setMethod's for the
target function occur in between? By "safe" I mean that all the
setMethod's remain in effect, and the 2nd call is, effectively, a no-op.
?setGeneric says nothing explicit about this behavior that I can see.
It does say that if there is an existing implicity generic function it
will be (re?)used. I also tried
2003 May 27
1
setGeneric?
In the last few days I've received couple of messages pointing out that our SparseM
package fails to install on the patched version of 1.7.0. Laurent Gaultier kindly
suggested that replacing:
setGeneric("as.matrix.csr")
by
setGeneric("as.matrix.csr", function(x, nrow, ncol, eps) standardGeneric("as.matrix.csr"))
was sufficient to fix the problem.
2004 Jun 19
0
setGeneric / standardGeneric when args are not "literals" - corrected
This is a correction to my previous message, I forgot to swap two lines
in the body of setMakeGenericMethod. Sorry about that. The correct (full
message) reads like this:
Hi,
This works
> setGeneric("clear", function(obj) standardGeneric("clear"))
[1] "clear"
but this doesn't. Why?
> funName <- "clear"
> setGeneric(funName,
2006 Dec 28
1
setGeneric and file order in a package
Are there any assumptions I can make about the order in which
different files in the R package subdirectory will be evaluated? For
example, will it be alphabetical in the file names? Will case
distinctions be ignored?
I ask because I would like to use setGeneric, as in
setGeneric("foo", function(x) standardGeneric("foo")) and am wondering
where that should go.
I realize I
2010 Sep 03
3
S4 Method Signatures
Hello,
If the signature of a method defines which generic it implements then I'm confused about why this minimal example I invented won't work :
setGeneric("myFun", function(rs, ...){standardGeneric("myFun")})
setGeneric("myFun", function(cs, ...){standardGeneric("myFun")})
setMethod("myFun", "numeric", function(rs, colour =
2002 Jan 06
1
How to get setGeneric() to work?
Dear all, I can't see how setGeneric() works. I know perfectly well how to
define
library(methods);
setClass("Square", representation(side="numeric"));
# Will become the default method.
getArea <- function(object) {
stop(paste("Method getArea() is not defined for this class:",
data.class(object)));
}
setMethod("getArea",
2008 Mar 13
3
Sealed for setGeneric
Hi the list
When two setGeneric occurs on the same function, the second erage the
first and erase all the function previously define.
Is it possible to prevent that ? Is it possible to declare a setGeneric
that can not be erased later ?
Something like the |sealed for setMethod...|
||
|Thanks|
||
Christophe
2018 Apr 19
0
odd assignInNamespace / setGeneric interaction
The problem is not specific to redefining the q function, but to
the interaction of assignInNamespace and setGeneric. The
latter requires, roughtly, that the environment of the function
being replaced by an S4 generic is (or is the descendent of)
the environment in which it lives.
E.g., the following demonstrates the problem
% R --quiet --vanilla
> assignInNamespace("plot",
2009 Jul 07
0
Protection stack overflow when calling setGeneric()/setMethod() from within .onLoad()
Hi list,
Calling setGeneric()/setMethod() from within the .onLoad() hook
of MyPkg package produces the following error:
> gctorture(TRUE)
> library(MyPkg)
.onLoad(): ok1
.onLoad(): ok2
Error : protect(): protection stack overflow
Error : .onLoad failed in 'loadNamespace' for 'MyPkg'
Error: package/namespace load failed for 'MyPkg'
This is with
2018 Apr 18
0
odd assignInNamespace / setGeneric interaction
Hi Bill,
Ideally, your coworker would just make an alias (or shortcut or
whatever) for R that passed --no-save to R. I'll try to look into this
though.
Michael
On Wed, Apr 18, 2018 at 1:38 PM, William Dunlap via R-devel
<r-devel at r-project.org> wrote:
> A coworker got tired of having to type 'yes' or 'no' after quitting R: he
> never wanted to save the R
2002 Jul 01
1
SetGeneric and formula interfaces
Hi,
while playing with the `methods' package I was not able to find what the
recommended way of dealing with the following problem is.
Suppose there is a generic function `foo' and two functions `foo.default'
and `foo.formula', in the classical way:
foo <- function(y, ...) UseMethod("foo")
foo.default <- function(y, ...) {}
foo.formula <- function(formula,
2006 Sep 12
1
package.skeleton() in R-2.4.1
Hi
R version 2.4.0 alpha (2006-09-06 r39158)
MacOSX 10.4.7
There was a thread some time ago as to whether the structure created by
package.skeleton() would pass R CMD check.
I have an example where package.skeleton() gives an R file that gives an
error when sourced.
If I type
setClass("brob",
representation = representation