similar to: S4 Package with definition of method 'names'

Displaying 20 results from an estimated 4000 matches similar to: "S4 Package with definition of method 'names'"

2009 Oct 27
1
How to reduce key strokes when defining S4 classes?
I feel tedious when I define a S4 class and the methods. For each method, I have to call both setMethod and setGeneric (or both setReplaceMethod and setGeneric). I would like a more compact grammar so that I can reduce the key strokes. I'm wondering if there is a better way available. setClass( Class='A', representation=representation( x='numeric' )
2009 Jun 15
1
S4: Bug in group method defenition ("Compare")
Dear UseRs, Setting methods for groups ("compare" in this case) does not work properly. Once one method is set ,redefining it or even removing does not change the behavior: setClass("foo" ,representation(range="numeric") ) #[1] "foo" setMethod("Compare",c(e1="ANY",e2="foo"), function(e1,e2){ browser()
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all, Assume that I have an S4 class "MyClass" with a slot "myname", which is initialized to: myname="" in method("initialize"): myclass <- new("MyClass", myname="") Assume that class "MyClass" has a method "mymethod": "mymethod.MyClass" <- function(object, myname=character(0), ...) {
2011 Sep 14
1
S4 method dispatch
List, In order to get rid of some old, unreadable S3 code in package sp, I'm trying to rewrite things using S4 methods. Somewhere I fail, and I cannot sort out why. In order to isolate the problem, I created two functions, doNothing<- and dosth, and both should do nothing. The issue is that in most cases they do nothing, but in some cases dosth(obj) changes the class of obj and breaks with
2010 May 12
1
slot assignment in S4 classes
Hi R friends,   I'm still studying S4 classes and I have a question about slot assignment. Why would I have to use a special setter method [example 2 below] if I can assign data to a slot directly when I call new() [example 1 below]?   ## first way to do it (the idiosyncratic way?) setClass(Class = "TestClass", representation = representation(myDf = "data.frame"))
2009 Mar 04
2
lattice: remove box around a wireframe
#Hi, # #somebody knows how to remove the outer box around a wireframe and reduce the height # # test = data.frame(expand.grid(c(1:10), c(1:10))) z = test[,1] + test[,2] test = cbind(test, z) names(test) = c("x", "y", "z") require(lattice) wireframe(z ~ x*y, data = test, par.box = c(col = "transparent") ) #not this one but the remaining outer box.
2017 Jun 27
0
[Rd] setReplaceMethod creates 'object' in the userworkspace
>>>>> Jonathan Fritzemeier <clausjonathan.fritzemeier at uni-duesseldorf.de> >>>>> on Fri, 23 Jun 2017 16:15:30 +0200 writes: > Hi, > I recognized that the function 'setReplaceMethod' is creating a > character vector in the user workspace having the name (e.g. "newClass") > of the class used as value. If you can
2010 Jun 09
0
Documenting generic S4 replacement method for package building
Dear List Members, I'm struggling with the documentation of a generic S4 replacement method. I've created a S4 method "lows" via setGeneric("lows", function(object) standardGeneric("lows")) setGeneric("lows<-", function(object, value) standardGeneric("lows<-")) setMethod("lows", "myClass", function(object) {
2006 Oct 31
1
setReplaceMethod
Hi If x <- 1:10 then x[5] <- 1i will promote x to be a complex vector. Suppose I have an S4 class "brob", and have functions is.brob(), as.brob(), as.numeric() and so forth (minimal self-contained code below). If x is numeric (1:10, say) and y is a brob, what is the best way to make x[5] <- y promote x to a brob in the same way as the complex example? Or is
2017 Jun 23
1
setReplaceMethod creates 'object' in the userworkspace
Hi, I recognized that the function 'setReplaceMethod' is creating a character vector in the user workspace having the name (e.g. "newClass") of the class used as value. If you can sort out a mistake by myself, I would like you to file a bug report. BBFN, Jonathan setClass("newClass", representation(value="numeric")) setMethod(f = "initialize",
2017 Jun 23
1
setReplaceMethod creates 'object' in the userworkspace
Hi, I recognized that the function 'setReplaceMethod' is creating a character vector in the user workspace having the name (e.g. "newClass") of the class used as value. If you can sort out a mistake by myself, I would like you to file a bug report. BBFN, Jonathan setClass("newClass", representation(value="numeric")) setMethod(f = "initialize",
2007 Dec 23
1
Problem with initialize of S4 classes
Dear all Below is the code for "scriptPreFilter.R" which gives the following result: > source("scriptPreFilter.R") > prefltr <- new("PreFilter", mad=c(0.5,0.01)) [1] "------initialize:PreFilter------" [1] "------initialize:Filter------" > str(prefltr) Formal class 'PreFilter' [package ".GlobalEnv"] with 2 slots
2007 May 25
1
Question about setReplaceMethod
Hi I have the code like I show below. The problem here is that I have a setReplacementMethod to set the value of my class slot. However, this function doesn't work when I call it within another function definition (declared by setMethod) of the same class. I do not understand this behavior that much. I'm wondering how to make this work? Any help would be really appreciated. Thank you.
2003 Jul 26
2
How to make "<-" generic?
Hi, perhaps a little bit unusual: is it possible to use "<- " as generic function with a new signature? The following example doesn't work: > isGeneric("<-") [1] FALSE > setClass("A",representation(x = "numeric")) [1] "A" > setClass("B",representation(x = "numeric")) [1] "B" > myAssign.A <-
2010 Jul 19
0
to extend data.frame or not ... that is the question
I am designing a package to analyze fire department data. I created an S4 class called CAD (short for Computer Aided Dispatch data) as part of this package that essentially extends the data.frame class. When the user initializes a CAD object, a data.frame object is broken down into seperate incident data and unit response data that are stored in separate slots. This separation is intentional
2011 Jun 04
1
S4 class, passing argument names to function, modify original
Hello, an S4 class "Foo" is defined with a setter, $. For several reasons, the setter calls a function, .foo.update(). However, bypassing the argument names of the setter does not work. Question 1: Why not and how can I fix this? Question 2: What is the way to define either the function or the setter to modify the original object (not returning the modified copy of it an overwrite the
2010 Jun 23
2
format: different S4 behavior in a package
R-Devel-ers: I have an S4 method that simply formats an object: setGeneric("formatMe", function(x) standardGeneric("formatMe")) setMethod("formatMe", "ANY", function(x) format(x)) If I issue the above in an R session, then define an S4 class with its own format method, I get the desired result: > setClass("A",contains="numeric")
2004 Jul 06
0
where is smbgroupedit and differenet other questions to Samba & AD
Hello List-Friends ;-) O.K. I am a real beginner, so please don't hurt me ;-) but im still working since a few days to get it running and google is my best friend. I also bought O'Reilly 's Samba Book and a lot of other online stuff, but AD-Samba-winbind should be too new. I use Suse 9.1 and Samba 3.0.4 as ADS Member Server. We have an W2k Advanced Server (and a M$-Admin which
2007 Nov 15
0
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
Hi, > Sadly, this will break a very common idiom. In GCC, we discovered it > to be common enough that it broke a *bunch* of C code. > > In particular, you will break > > struct foo { > int a; > char name[0]; > } > > bar = malloc(sizeof (struct foo) + strlen("thisismyname") + 1); > strcpy(bar->name, "thisismyname"); > > > It
2003 Apr 19
1
Re: RV: Re: My 1st BW Manager
Original Message: ----------------- From: Stef Coene stef.coene@docum.org On Saturday 19 April 2003 12:10, GoMi wrote: >> Stef, if you are interested in working around this problem, maybe we >could >> meet in a chat room, and you can login to my box and see what happens, >> interested? >Yes, but not now. But I can check it out myself. >How do this DAP works? Do they