similar to: Infinite recursion in getGeneric (PR#4561)

Displaying 20 results from an estimated 8000 matches similar to: "Infinite recursion in getGeneric (PR#4561)"

2004 Jun 26
1
S4 group "Math", "getGroupMembers", "genericForPrimitive"
Hi, I found the following on Windows 2000/NT R Version 1.9.1 (2004-06-21) (also Version 1.9.0): The S4 group "Math" doesn't work as documented; i.e., "log", "log10", "gamma" and "lgamma" are included in the documentation but don't work. See example code below. Moreover, what about 'genericForPrimitive' which is used in
2002 May 08
1
Questions about S4 style methods and generics
I have some questions about S4 style methods and generics. First of all, is there any way of using default values for arguments in the generics/methods? My own experiments show that such arguments are always ignored. The green book seems to be silent on this matter. The second question is about using a non-trivial function body for generics. Page 351 of the green book gives an example of this
2004 Jan 29
1
setMethodReplace.. Help!
Hi! Trying to reproduce some examples from "Programming with Data" page 341. Can not reproduce it neither on R1.8.1. nor R1.9.0devel? library(methods) setClass("track",representation(x="numeric",y="numeric")) setMethod("[" ,"track" ,function(x,...,drop=T){ track(x at x[...],y at y[...]) }
2003 May 30
3
Missing 'getGroupMembers()'
Hi, I'm trying to write a method such that my own classes can be used with the groups like "Summary" and "Math", but when I tried to look for examples or just wanted to get an idea of which functions are the members of a group, I found out that the function "getGroupMembers" is not present... I couldn't find an alternative function, if there is one. Does
2006 Sep 23
1
generics for primitive functions
i think these two code snippets exhibit a bug. they are identical but for the inclusion of an initial line in snippet [2] [1] setMethod("Math", signature(x = "numeric"), function(x) "Works") getGeneric("sqrt")(4) [2] getGeneric("sqrt")(4) setMethod("Math", signature(x = "numeric"), function(x) "Works")
2015 Jan 29
3
[Q] Get formal arguments of my implemented S4 method
On Jan 28, 2015, at 6:37 PM, Michael Lawrence <lawrence.michael at gene.com> wrote: > At this point I would just due: > > formals(body(method)[[2L]]) > > At some point we need to figure out what to do with this .local() confusion. Agreed, definitely. The current hack is to avoid re-matching arguments on method dispatch, so a fix would need to be fairly deep in the
2015 Jan 29
2
[Q] Get formal arguments of my implemented S4 method
I wish it didn't have to depend on the name '.local'. Back when I wrote a lot of S4 methods I avoided the auto-generated .local and named the local function something that made sense so that is was easier for a user to track down the source of an error. E.g., define the generic QQQ with numeric and integer methods: setGeneric("QQQ", function(x, ...)NULL)
2003 Sep 05
2
S4 Method Collisions with "[" (PR#4075)
Full_Name: Colin A. Smith Version: 1.8.0 OS: Mac OS X 10.2.6 Submission from: (NULL) (216.102.90.18) Both Biobase and my package annaffy use S4 classes to define methods for "[". Both packages use the save image method of installation. (See annaffy 1.0.3 in BioC CVS.) Depending on how both packages are loaded, the Biobase definitions seem to be getting masked out: >
2005 Jan 13
3
as.character methods
Hello, ?as.character says that the as.character function is a generic with usage: as.character(x, ...). So, I want to create an S4 object with an as.character method following the above usage, but I get the below error telling me that ... isn't in the generic for as.character. > setClass("tmp", "numeric") > setMethod("as.character", "tmp",
2005 Jan 13
3
as.character methods
Hello, ?as.character says that the as.character function is a generic with usage: as.character(x, ...). So, I want to create an S4 object with an as.character method following the above usage, but I get the below error telling me that ... isn't in the generic for as.character. > setClass("tmp", "numeric") > setMethod("as.character", "tmp",
2002 Aug 06
2
[ and setMethod conflict?
I noticed this oddity about [ and setMethod. First, I define testFunc, which sorts a data frame by the first column and returns the entries that aren't NAs, and testIt, which runs testFunc repeatedly on a random large data frame, each time saving the return into a dummy placeholder (for demonstration's sake). > require(methods) Loading required package: methods [1] TRUE > testFunc
2002 Aug 06
2
[ and setMethod conflict?
I noticed this oddity about [ and setMethod. First, I define testFunc, which sorts a data frame by the first column and returns the entries that aren't NAs, and testIt, which runs testFunc repeatedly on a random large data frame, each time saving the return into a dummy placeholder (for demonstration's sake). > require(methods) Loading required package: methods [1] TRUE > testFunc
2015 Jan 29
1
[Q] Get formal arguments of my implemented S4 method
Would we really need the special class or would simply checking the formals of the method against those of the generic be simple and fast enough? On Thu, Jan 29, 2015 at 9:41 AM, John Chambers <jmc at r-project.org> wrote: > I wouldn't want to add more to the current approach; if someone would like > to devote some time, the much preferable idea IMO would be to replace the >
2003 Nov 19
2
Was: setValidity and "initialize" method conflict ? [in R-help]
Hello, Thomas Stabla (statho3@web.de) has already sent this question to R-help, Wed, 12 Nov 2003 21:21:31 +0100, but we are not sure whether we should better post this mail to this audience than to R-help: --------------------------------------------------------------------- We are using S4-classes and want to force a validity check when an object is created. How can this be done, when an
2004 Sep 29
1
Problem with _new_ if class "lm" in object representation.
Hi! Consider this code. setClass("Ctest" ,representation( test="character" ,bla="character" ,mod="lm" ) ) new("Ctest",test="bla") #This produces an error. #Error in validObject(.Object) : Invalid "Ctest" object: Invalid object for slot "mod" in class "Ctest": got class
2003 May 24
2
Re: R-devel Digest, Vol 3, Issue 23
I am another person who has had trouble documenting S4 classes and (particularly) methods. The methods package itself is pretty cool by the way, but it is a pity that there are as yet no guidelines on S4 in the "Writing R Extensions" document. I have actually put together a guide on S4 documentation myself for the use of my own lab which is at
2003 Mar 02
1
'methods' and "[<-"
Dear List, I am trying to override the replace method "[<-" for objects of class "matrix"... with little success... Would anyone know where I am wrong ? > library(methods) > setReplaceMethod("[", "matrix", function(x, i, j, ..., value) {cat("I'm here.\n")}) [1] "[<-" > m <- new("matrix", 0, 5, 2) >
2004 Jul 14
2
tracing something in a namespace (PR#7091)
# Your mailer is set to "none" (default on Windows), # hence we cannot send the bug report directly from R. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # r-bugs@r-project.org # ###################################################### > x <- rnorm(10) > y <- 1:10 > xyplot(y ~ x) >
2003 May 21
1
callNextMethod
Hi, I don't understand why this code doesn't work (f(b2)): ///////////////// setClass("B0", representation(b0 = "numeric")) setClass("B1", representation("B0", b1 = "character")) setClass("B2", representation("B1", b2 = "logical")) f <- function(x) class(x) setMethod("f", "B0",
2002 Sep 18
1
attach()ing User-Defined Classes with Complex Structures
How would you implement attach()ing to a user-defined class with multiple slots in R? A primary goal of my software is to hide the data representation from the user, allowing them to attach() to my program's complex classes and refer to their contents by name - THEREBY avoiding having to pass the classes to every function call. Also, is it true that attaching to a to a sub-classed list