similar to: How to check the code for generic function in a specific package?

Displaying 20 results from an estimated 40000 matches similar to: "How to check the code for generic function in a specific package?"

2004 Aug 26
5
Problems with par() and labels with boxplot
Quite a simple one really! When I run boxplot(), the labels on the X axis are horizontal, and I want them vertical. So I did: par(las=3) boxplot(...) And my labels just aren't there anymore.... Any help???
2005 Jun 02
1
showMethods doubt
Hi, I'm developing in S4 and I wanted to see the methods for a specific class using showMethods but I didn't succed. Can someone help ? See the example below. setClass("myclass", representation( name ="character" ) ) setGeneric("mymeth", function(obj, ...){ standardGeneric("mymeth") } ) setMethod("mymeth",
2009 Jun 05
2
Problem with generic methods
Hi I want to create a new generic method, but I end up with an error (evaluation nested too deeply). see the transcript below. The function beginYear.Fun() works, but not beginYear. I have no idea why. Any ideas welcome, Rainer > setClass("fun", representation(x = "numeric")) [1] "fun" > new("fun") An object of class ?fun? Slot "x":
2003 Aug 21
2
efficiency and memory use of S4 data objects
I do lots of analyses on large microarray data sets so memory use and speed and both important issues for me. I have been trying to estimate the overheads associated with using formal S4 data objects instead of ordinary lists for large data objects. In some simple experiments (using R 1.7.1 in Windows 2000) with large but simple objects it seems that giving a data object a formal class
2004 Nov 11
1
"<<-" assignment no long work in class methods
Hi- I used to use "<<-" to do assignment inside a class method, and just found that now it is broken in R 2.0. For example, the following code ----------------------------------------------------------------------- setClass( "myclass", representation(x="numeric") ) setGeneric("incrXByOne", function(obj) standardGeneric("incrXByOne"))
2003 Dec 02
1
setMethod("min", "myclass", ...)
Hello, I have defined a new class > setClass("myclass", representation(min = "numeric", max = "numeric")) and want to write accessor functions, so that for > foo = new("myclass", min = 0, max = 1) > min(foo) # prints 0 > max(foo) # prints 1 At first i created a generic function for "min" > setGeneric("min",
2014 Jan 07
1
Why do methods of "initialize" have no "srcref" attribute as other S4 mehtods?
For documentation we use a system that generates Rd files from special comments in the code. (inlinedocs). It is crucial to be able to get the defining source code for objects like methods to extract the comments from it. Here is an R session that shows how this works for several kinds of methods and (at the end of the session) how if fails for methods of "initialize" >
2005 Mar 26
2
Is there a diferent way to do this?
Hi, I started creating a small class but I'm courious about how it is working. To create a instance of my class "Partri" I write this at Rgui: x <- new("Partri", name="Gilvan") and to change the slot "name" of this instance, I write: setName(x, newname="Justino") It is not working, because when I type "x" at Rgui, it shows
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"),
2002 Jul 19
1
Rprof and setMethod conflict?
I noticed this oddity about R profiling and setMethod. First, I "test out" Rprof. > require(methods) Loading required package: methods [1] TRUE > > Rprof("test.out") > data.frame("a") X.a. 1 a > Rprof(NULL) So far, so good. Next, I define myClass. > setClass("myClass", representation(mySlot = "numeric")) [1]
2005 Dec 07
1
Dots argument in apply method
Hello everyone, I'm working on a package using S4 classes and methods and I ran into the following "problem" when I tried to create an "apply" method for objects of one of my new classes. I've found a way around the problem but I wonder if I did not paint myself into the corner. I'd like your opinion about that. So I have an object "myObj" of class
2002 Feb 17
5
Horizontal Boxplot
Hello all. I'm just a beginner trying to draw a boxplot and I don't know why every time I try to make it horizontal I receive the error message "parameter 'horizontal' couldn't be set in high-level plot() function". Can anybody give me an advice? Here is the code: opar <- par(ask = interactive() && (.Device == "X11" || .Device ==
2005 Nov 18
3
Method for $
Dear R experts, I have defined a class "myclass" and would like the slots to be extractable not only by "@" but also by "$". I now try to write a method for "$" that simply executes the request object at slotname, whenever someone calls object$slotname for any object of class "myclass". I don't manage to find out how I can provide this
2005 May 27
4
plotting box plots on same x
I am trying to construct a graph of 6 box plots of blood pressures. I want them to be on a single set of axis and I want the SBP to be ontop of the DBP. I have an array bp with the data in it and I tried a[1,]<-c(145,60,147,62,140,57) a[2,]<-c(160,75,160,74,160,70) a[3,]<-c(140,55,140,65,142,55) boxplot(data.frame(a), main = "Blood Pressures", at=c(1,1,2,2,3,3),
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, ...) { } )
2002 Jul 03
2
grouping in scatterplot3d
Hi all, I've been using the scatterplot3d function (from the scatterplot3d library) to create 3D plots. I was wondering whether there is anyway to group the points according to a particular group variable. For example I used the plot function as plot( factor( <GROUPINGVAR> ) , <PLOTVARS> ) to organise the results in a according to the grouping variable. I was wondering
2011 Jun 29
1
Ref Classes: bug with using '.self' within initialize methods?
Dear list, I'm wondering if the following error I'm getting is a small bug in the Reference Class paradigm or if it makes perfect sense. When you write an explicit initialize method for a Ref Class, can you then make use of '.self' WITHIN this initialize method just as you would once an object of the class has actually been initialized? Because it seems to me that you can not.
2009 Jul 09
1
class export in package creation / setClass / namespace?
Dear all, I have been trying to create an R package. This has been successfull until I tried to define classes. Currently, my procedure is the following: Start R, load the function and class definition >tmp <- function (x) {x} >setClass("rpa", contains = "list", where=topenv(parent.frame())) Use package skeleton to create directory structure:
2012 Apr 12
1
R-2.15.0 and Exporting Methods Converted To S4 Generic
Late to the show on this release, unfortunately. One of our production packages no longer builds under R-2.15.0 with the following message. ** testing if installed package can be loaded Error: Function found when exporting methods from the namespace 'SuperCurve' which is not S4 generic: 'image' Possibly relevant clues follow: ## From R/AllGenerics.R if
2008 Apr 07
3
Overriding axis formatting with custom Axis method, Axis.numeric etc
Dear list: I would like to override the default way R formats plot axes with a custom method(s). Obviously I would prefer to define it as general as possible avoiding writing a custom method for each individual class where possible. The plot.default method (and I assume other methods as well) calls Axis(...) to produce the axis layout depending on data. In this sense it seems reasonable to