similar to: Wondering about methods (selecting a less specialized method)

Displaying 20 results from an estimated 5000 matches similar to: "Wondering about methods (selecting a less specialized method)"

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)
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 Nov 01
3
Curry: proposed new functional programming, er, function.
Hi all (especially R-core) I suppose, With the introduction of the new functional programming functions into base I thought I'd ask for a Curry() function. I use a simple one that looks this: Curry = function(FUN,...) { .orig = list(...);function(...) do.call(FUN,c(.orig,list(...))) } This comes in really handy when using say, heatmap():
2005 Mar 25
1
S4 methods semantics questions
Some quick questions about S4 methods. Does the typing of S4 methods mean that lazy evaluation is no longer possible? It seems that you would need to evaluate the arguments to determine their type at dispatch. Second, what role, if any, do default arguments play in S4 methods? I notice that you can put default arguments into generics but that the dispatch is still done on the type of the
2005 Dec 23
2
cairo anyone?
Has anyone taken a shot at a Cairo graphics device yet? I half expected to see one on either Paul's pages or Omegahat. :-) --- Byron Ellis (ellis at stat.harvard.edu) "Oook" -- The Librarian
2003 Sep 14
2
Problem building methods package?
For the last, I dunno, week or so I've been unable to build R... I finally took the time to investigate and the crash is in building 'methods': all.R is unchanged ../../../library/methods/man/methods.Rd is unchanged make[2]: `Makedeps' is up to date. ../../../../library/methods/libs/methods.so is unchanged make[1]: Nothing to be done for `Rfiles'. Any clues to where this
2001 Apr 29
4
Rgui crash (PR#926)
Full_Name: Byron Ellis Version: 1.2.3 OS: Windows 2000 Server Submission from: (NULL) (140.247.105.95) In Rgui when attempting to resize the console the system locks for a second (cursor locks up, etc) and then either returns to normal for a second before crashing or just crashes when we start moving again (the former happens more often when making things bigger, the latter when the console is
2019 Mar 14
2
selectMethod() can fail to find methods in situations of multiple dispatch
Here is an example: setGeneric("foo", function(x, y) standardGeneric("foo")) setMethod("foo", c("numeric", "ANY"), function(x, y) cat("I'm the foo#numeric#ANY method\n") ) Dispatch works as expected but selectMethod() fails to find the method: > foo(1, TRUE) I'm the foo#numeric#ANY method >
2009 Nov 25
1
group generics
I have classes A and B, where B contains A. In the implementation of the group generic for B I would like to use the corresponding group generic for A. Is there a way to do that? I would also appreciate any comments if what I'm trying to do seems like the wrong approach. Here's a stripped down example: setClass("A",
2005 Dec 29
1
reinventing the wheel....
> ---------- Forwarded message ---------- > From: Byron Ellis <ellis at stat.harvard.edu> > If we wanted to be truly radical we'd just accept that graphics > devices and event loops are just special cases of the connection and > merge the whole thing, thus more-or-less reinventing CLIM. :-) Eventually, all programming languages grow up and become Lisp. (progress,
2010 Apr 19
1
SSH limits
Hi, I have some questions about ssh server and Linux, hope someone can help me :) 1. Does Ssh server have a limit for the number of users that can connect ? 2. Does Ssh have restrictions about an username length? Or username format? We would like to use something like: foo_<GUID> ex: foo_ 5CEB80CF-150F-4ff0-8743-A6493FA200C1 3. Does Linux have a limit of user
2005 Apr 25
2
RAW types not restored from Rda files (PR#7812)
Full_Name: Byron Ellis Version: 2.1.0 OS: OS X Submission from: (NULL) (67.124.246.46) > x = charToRaw("12345") > x [1] 31 32 33 34 35 > save(x,file="x.Rda") > rm(x) > load("x.Rda") > x [1] 00 00 00 00 00 Thats no fun.
2019 Mar 22
2
selectMethod() can fail to find methods in situations of multiple dispatch
Hi Michael, Thanks for looking into this. I suspect that truncation of ANY suffixes from method signatures is also the culprit behind the sudden breakage of aliases of the form \alias{foo,numeric-method} when a method without the ANY suffix in its signature gets added to the ecosystem. See my post about this to the Bioc-devel mailing list a couple of months ago:
2019 Mar 22
2
selectMethod() can fail to find methods in situations of multiple dispatch
Fine with me as long as eliminating the inconveniences associated with it can be put on the roadmap. The alias instability and the fact that the user has no way to know if s/he should do ?`foo,numeric-method` or ?`foo,numeric,ANY-method` to find the method has been a long-standing problem. H. On 3/21/19 21:29, Michael Lawrence wrote: If we started over, I'd try to avoid this sort of
2007 Aug 16
1
methods and try()
Hi all, I'm having a problem with some sort of interaction with try() and methods, I think. The setup is as follows, I have an S4 class that holds an environment and I would like to evaluate the right hand side of a function inside that environment. No problem there. However, if the formula involves a symbol that doesn't exist, which may or may not happen, it fails as it should and
2002 Jun 19
1
Anon CVS updates?
Is the anonymous CVS repository for R presently broken? There haven't been many updates coming through and the repository files seem to differ significantly from the rsync version of R-devel... Byron Ellis (bellis@hsph.harvard.edu) "Oook" - The Librarian Please finger bellis@hsph.harvard.edu for PGP keys
2008 Oct 21
1
---without-x option fails for R 2.8.0 (missing ;) (PR#13188)
Full_Name: Byron Ellis Version: 2.8.0 OS: Linux Submission from: (NULL) (64.124.65.175) There is a missing ';' just above platform.c:1661 on the line "X11 = FALSE" that causes compilation errors when X11 libraries are not being used.
2004 Apr 27
1
'R CMD build' fails when there are spaces in the path (PR#6830)
Full_Name: Byron Ellis Version: R 1.9.0 (and 2.0.0) OS: Linux (Redhat Fedora Core) Submission from: (NULL) (140.247.241.197) It appears that `R CMD build` cannot handle spaces in the path when building packages for distribution. For instance: [ellis@net-78815 ~/Bayesian Networks]$ R CMD build bnsl * checking for file 'bnsl/DESCRIPTION' ... OK * preparing 'bnsl': * cleaning src *
2011 Jun 01
1
Overloading S4 methods
Dear all, I am experiencing some problems with S4 method overloading. I have defined a generic for graphics:plot, using setGeneric("plot", useAsDefault = plot) and with importFrom('graphics', 'plot') and exportMethods('plot') in the NAMESPACE file of pkg A. I then proceed to define a method for signature c('myS4class', 'missing'). This works
2001 Apr 07
2
silent extern error (PR#898)
Full_Name: Byron Ellis Version: 1.2.2 OS: all Submission from: (NULL) (140.247.105.95) R_ext/Arith.h #ifdef MAIN #define extern #endif #ifdef __cplusplus extern "C" { #endif these two should be reversed. Its never a problem because builds aren't done against C++ compilers, but its still an error (just a low priority one). also, you could change that to #ifdef __cplusplus extern