similar to: callNextMethod

Displaying 20 results from an estimated 5000 matches similar to: "callNextMethod"

2011 Dec 09
1
'callNextMethod' in a '[<-' function does not work ?
Hi the list, I try to use callNextMethod in a setteur ([<-) but it does not work. Any raison ? Any other option ? --- 8< ------------------ ### Class B0 ### setClass("B0" , representation(b0 = "numeric")) setReplaceMethod("[","B0",function(x,i,j,value){x at b0 <- -value}) a <- new("B0") a at b0 <- 3 a a["b0"] <- 3 a
2010 Jul 20
1
Extract callNextMethod "array" calls "matrix"?
I have a class that extends array and my method for "[" stops with an error: > setClass("A", contains="array") [1] "A" > setMethod("[", "A", function(x, i, j, ..., drop = TRUE) new("A", callNextMethod())) [1] "[" > a<-new("A",array(1:12,c(4,3,1))) > a An object of class "A" , , 1
2012 Aug 03
1
Interaction between callNextMethod() and selectMethod()
Hi, Strange things happen. Here is a simple example: > setClass("A", contains="integer") > setMethod("as.matrix", "A", function(x, ...) t(callNextMethod())) Creating a generic function for ?as.matrix? from package ?base? in the global environment [1] "as.matrix" > a <- new("A", 1:3) > as.matrix(a)
2006 May 11
2
S4 initialize methods, unexpected recursive callNextMethod
Hi, Given a simple three class hierarchy: A <-- B <-- C I want to define an initialize method for each class such that when I call new("C", x=5), the initialize methods for A and B are used to incrementally build the object. When I do what seems obvious to me using callNextMethod, I get an infinite recursion. An example follows... setClass("A",
2010 Jan 13
1
bug in callNextMethod (PR#14185)
Hi, there seems to be a possible bug in callNextMethod in conjunction with the [-operator. Relevant info, minimal example and sessionInfo follow below: ############################### setClass("foo", representation = representation(a = "numeric")) setClass("bar", contains = "foo") setMethod( f = "[", signature =
2012 Nov 06
2
Question on callNextMethod
I don't understand why I get the following results. I define two classes 'Base' and 'Derived', the latter of which 'contains' the first. I then define a generic method 'test' and overload it for each of these classes. I call 'callNextMethod()' in the overload for Derived. From the output, it appears that the overload for Base gets called twice. Why is
2010 Sep 23
1
strange behaviour of callNextMethod in S4 methods
Hello, I experienced a strange behaviour of callNextMethod when used in either initialize or any other S4 function method definition. Help says callNextMethod calls the next inherited method for the current function from where it is called with the same actual (non missing) arguments. This is OK. The problem appears when some formal arguments (in particular, S4 objects) of this function are
2007 Mar 04
1
Problem using callNextMethod() in S4
Dear all, Maybe, I am doing something wrong, but using R-2.5.0 on my Intel-Mac, I have problems using function callNextMethod() in method initialize. I am loading the following code as file "testS4.R": setClass("baseClass", representation(myname = "character", mydir = "character", "VIRTUAL"),
2005 Apr 20
1
callNextMethod()
I have built a sequence of eight S4 classes, each of which inherits from the previous one but adds extra slots. I have a corresponding generic function for which I have described methods for each of these classes in a signature with one other variable. There are also some ad hoc variable outside the signature which have different default values for each class. Each method calls
2007 Jun 19
3
another issue with highlighting
Hi, I''m encountering another highlighting issue. (about the first one "range search and highlighting", i received no response. I don''t even know if somebody tried to reproduce and/or if it''s normal behavior) about the new issue, an example will be easier for you to reproduce: I''m filling an index with random data, i try to match for "*1*"
2009 Jun 05
2
S4: When is validObject issued? (or why S4 is killing me:( ..
Dear UseRs, Does anyone know when exactly the validity is checked in S4? Documentation is silent:(. Here is a small example: setClass("test1",representation(a="numeric")) setMethod("initialize","test1", function(.Object,...){ a<-runif(1) ## here slot "a" is initialized ## callNextMethod(.Object,a=a,...)
2008 Mar 20
1
setMethod for "["
Hi R-Help, Please consider the following simple case: I have a class like setClass("myClass", representation(x="matrix", y="character")) and I would like to use the method *"["* for a *myClass* objects (but changing the default *drop* argument from TRUE to FALSE): setMethod("[","myClass", function(x,i,j,...,drop=FALSE)
2007 Dec 24
0
callNextMethod() with builtin group methods fails to create proper environment
Hi all, After all these years, I am finally porting some R-2.3.1-based S4 object code to R-2.6.1, dealing with all the S4 object system changes that came in R-2.4.0. I've run across what appears to be some sort of ommission in the implementation of callNextMethod() when used with primitives having group generic methods. In a stock R-2.6.1 patched (happens to be running on AMD64/RHEL 4, but
2003 May 26
4
"Tcl/Tk support is not available on this system, " RH 9, R 1.7.0-1
In trying to run John Fox's new Rcmdr package on Redhat Linux 9, I got this error message. The problem is in loading the tclck library. library(tcltk) produces the same error. It has been discussed before, e.g., http://finzi.psych.upenn.edu/R/Rhelp02/archive/11898.html but with respect to earlier versions of Linux and R. I tried updating to the latest RPMs of tcl and tk (8.3.5-89), but that
2005 Aug 05
1
S4 generating function
Can someone explain what the problem is when I use the generating function? And how to get debug() to stop in the Superclass initialize method? ---- source ----- setClass("Superclass", representation(id = "character"), contains = "VIRTUAL") setMethod("initialize", signature(.Object = "Superclass"),
2014 Feb 11
1
getting environment from "top" promise
Hi all, It seems that there is a use case for obtaining the environment for the "top" promise. By "top", I mean following the promise chain up the call stack until hitting a non-promise. S4 data containers often mimic the API of base R data structures. This means writing S4 methods for functions that quote their arguments, like with() and subset(). The methods package
2008 Sep 09
0
Defining an alias for a generic function and callNextMethod() strange behaviour
Hi, My package contains the following foo() generic and methods (simplified version): setGeneric("foo", signature="x", function(x, y=NA) standardGeneric("foo")) setMethod("foo", "ANY", function(x, y=NA) list(x, y)) setMethod("foo", "character", function(x, y=NA) unlist(callNextMethod())) > foo(5) [[1]]
2010 Feb 02
1
S4 setClass / initialize misunderstanding
Hi, I recently ran into this problem. I couldn't find any mention of it in the setClass documentation. setClass("Foo", representation(file = "character")) setMethod("initialize", "Foo", function(.Object, file) { print(file) }) setClass("Bar", contains = "Foo") And the error: Error in print(file) : argument "file" is
2011 Mar 11
1
WARNING Undocumented S4 methods 'initialize' - why?
Dear all, I am just writing the documentation file for S4 class 'QualTreeSet' and get the following warning with R CMD check: * checking for missing documentation entries ... WARNING Undocumented S4 methods: generic 'initialize' and siglist 'QualTreeSet' All user-level objects in a package (including S4 classes and methods) should have documentation entries. See the
2008 Sep 09
1
building a package that contains S4 classes and methods
Hello R users, I am trying to make a my first package and I get an error that I can understand. The package is build out of three files (one for functions, 1 for s4 classes and 1 for s4 methods). Once I source them I run package.skeleton( name="TDC" ) within a R session and I get Creating directories ... Creating DESCRIPTION ... Creating Read-and-delete-me ... Saving functions and