Displaying 20 results from an estimated 20000 matches similar to: "RFC: methods() and showMethods() {was "debug"}"
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",
2013 Mar 13
1
S4 generic not exported correctly / incorrect dispatch?
In this post
https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004152.html
a package author reports that S4 dispatch fails. I can reproduce this with a
PkgA (attached; 'intervals' is a relatively light-weight CRAN package) that has
DESCRIPTION with
Depends: intervals
Imports: graphics
NAMESPACE:
importFrom(graphics, "plot")
export("plot")
2014 Jul 11
1
Namespaces and S4 Generics
I've installed R-devel
R Under development (unstable) (2014-07-09 r66111)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
and am trying to resolve some problems that I am seeing with my
SparseM package. In prior versions I explicitly had:
setGeneric("image", function(x, ...) standardGeneric("image"))
and then used setMethod to define a method for the class matrix.csr
but
2011 Mar 04
3
Generic mixup?
Hello list.
This is from an R session (admittedly, I''m still using R 2.11.1):
> print
function (x, ...)
UseMethod("print")
<environment: namespace:base>
> showMethods("print")
Function "print":
<not a generic function>
Don''t the two results contradict each other? Or do I have a terrible
misunderstanding of what
2006 Oct 17
1
Caching bug with showMethods?
showMethods isn't reporting inherited methods when it is first
called. The methods are there and after calling them, showMethods
gives the right output.
Here is an example (using R-devel r39647):
setClass("A", representation(x="numeric"),
prototype=list(x=1))
setClass("B", contains="A",
prototype=list(x=2))
2010 May 27
2
Methods to explore R data structures
Hi,
I'm very confused about R structures and the methods to go with them. I'm
using R for microarray analysis with Bioconductors. Suppose without reading
the documentations, what's the best way to explore a data structure when you
know nothing about it?
I am currently using is() / class() to see what the object is. str() /
attributes() to probe inside the object, and
2010 Aug 01
2
How to understand whether a class is a S3 class?
Hi, is there any way to say: "this class 'x' is a S3 class?" For example what is the type of class "data.frame"? Is it a S3 class or S4?
How can I get a complete list of all S3 classes currently available?
Thanks,
2010 Jul 02
2
S4 classes and debugging - Is there a summary?
Dear all,
I'm getting more and more frustrated with the whole S4 thing and I'm
looking for a more advanced summary on how to deal with them. Often I
get error messages that don't make sense at all, or the code is not
doing what I think it would do. Far too often inspecting the code
requires me to go to the source, which doesn't really help in easily
finding the bit of code
2010 Mar 16
1
Problem with S3 to S4 transition
Hello to everybody
I am developing a package using R and have the following problem:
I used to work in a mixture of S3 and S4 mechanism environment: as a
matter of fact, I used to define my classes (say "DB" for illustration)
using the setClass function (with representation field), and
I was using the S3 implicit mechanism writing the functions: print.DB
and plot.DB.
Recently, I
2006 Jan 05
1
Generic Functions
Hi,
I've been using the package "graph" in the BioConductor assortment and
writing some functions based on its classes. My question is not specific to
this package or BioConductor (I think), but it serves as a useful example.
I recently wanted to look at the code for the function "edgeMatrix" for the
class "graphNEL".
Usually I would type
> func.foo
and
2010 Dec 09
1
warning creating an as.array method in a package
I posted on this topic to r-help, but never got a sufficient answer, so
I'm reposting here.
[Env: R 2.11.1, Win Xp, using Eclipse/StatET]
In a package I'm working on, I want to create as.matrix() and as.array()
methods for a particular kind of
object (log odds ratios). These are returned in a loddsratio object as
the $coefficients component,
a vector, but really reflect an underlying
2010 May 21
1
S4 method defined but not used
Dear R developers,
I am having a slightly weird issue with a S4 method defined in my package adegenet 1.2-4, with R 2.11.0. As far as I know, the problem is new, and the code implementing the method has not changed for more than a year and worked well so far.
The problem is the following. I define, in the package, a method "[" for the S4 class 'genind'. The method's
2002 Nov 05
1
function showMethods and inheritance
Hi,
The following question might come from my (deep) misunderstanding
of the concepts in the package 'methods'.
I have a class 'A', and a class 'B' inheriting 'A' (so defined
with 'setClass' and the parameter 'contains="A"'. The class
A has a method 'mymethod'. A call to 'showMethods("mymethod")'
return the
2009 Mar 11
1
Could you please add "time<-" as a generic function in the 'stats' package ?
Dear R developers,
As you might have noticed, recent changes in R-dev will not allow the
definition of S3 methods with S4 classes.
But until now, we have defined "time<-" in our 'timeSeries' package as
an S3 generic because other packages are using the same function.
Indeed, if we had defined it as an S4 generic, the other packages
would not coexist well with ours.
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 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a
new class and am trying to set a method for it for S4 group generic
"Summary". I have run into some signature problems. An example:
> setClass("track", representation(x="numeric", y="character"))
[1] "track"
> setGeneric("max", group="Summary")
2009 Nov 27
1
my failing understanding ...
The following I do not understand, but then I did'nt really use
S4 methods ...
> showMethods(plot)
Function: plot (package graphics)
x="ANY"
x="lmList.confint"
x="merMCMC"
(inherited from: x="ANY")
> plot(x=moda0MCMC)
Error in as.double(y) :
cannot coerce type 'S4' to vector of type 'double'
> class(moda0MCMC)
[1]
2007 May 27
2
[Bioc-devel] promptClass
promptClass fails to identify methods associated with the class. Here
is a fix:
Index: promptClass.R
===================================================================
--- promptClass.R (revision 41719)
+++ promptClass.R (working copy)
@@ -165,7 +165,7 @@
if (nmeths > 0) {
.meths.body <- " \\describe{"
for (i in 1:nmeths) {
- .sigmat
2009 Feb 15
1
Overloading in R
I have been trying to write a new class that reimplements the vector
class. As a test of my overloading I decided to try and and call
t.test on two vectors which were objects of my class rather than the
default class.
The overloaded length I wrote seems to work correctly. I used
setMethod("length", "myvector", ...)
setMethod("mean", "myvector", ...)
2013 Jul 02
2
cache most-recent dispatch
Hi,
S4 method dispatch can be very slow. Would it be reasonable to cache the
most
recent dispatch, anticipating the next invocation will be on the same
type? This
would be very helpful in loops.
fun0 <- function(x)
sapply(x, paste, collapse="+")
fun1 <- function(x) {
paste <- selectMethod(paste, class(x[[1]]))
sapply(x, paste,