search for: standardgeneric

Displaying 20 results from an estimated 292 matches for "standardgeneric".

2006 Oct 19
1
default arguments in generics and methods
...intended behavior and will continue: if a default argument is employed in the definition of a generic function, and the generic is called with the argument in question (call it 'ARG') missing, then the method for signature (..., ARG = "missing", ...) will be called by 'standardGeneric' whether or not ARG is evaluated in the body of the generic prior to the call to 'standardGeneric'; however, the value assigned to ARG in the method call will depend on whether ARG was evaluated in the body of the generic prior to the call to 'standardGeneric' (with the...
2016 Mar 03
2
as.vector in R-devel loaded 3/3/2016
I just installed R-devel to check my package before submitting. I got an error in my vignette in regards to as.vector. When I looked at the code for as.vector in R-devel it is standardGeneric for "as.vector" defined from package "base" function (x, mode) standardGeneric("as.vector") <environment: 0x0918ad70> Methods may be defined for arguments: x, mode Use showMethods("as.vector") for currently available ones. The code from R3.2.3 is &g...
2008 Nov 25
2
dots methods: dispatch issues
There seems to be a bug arising when using multiple S4 generics with "..." as the signature. The following code works as expected: ############################################################## > setGeneric("rbind", function(..., deparse.level=1) standardGeneric("rbind"), + signature = "...") Creating a generic for "rbind" in package ".GlobalEnv" (the supplied definition differs from and overrides the implicit generic in package "base": Signatures differ: (...), (deparse.level)) [1] "r...
2011 Aug 03
1
NAMESPACE problems
...dingnag.Rcheck/00install.out * installing *source* package ?Brobdingnag? ... ** R ** inst ** preparing package for lazy loading Creating a generic for ?max? in package ?Brobdingnag? (the supplied definition differs from and overrides the implicit generic in package ?base?: Classes: "nonstandardGenericFunction", "standardGeneric") Creating a generic for ?min? in package ?Brobdingnag? (the supplied definition differs from and overrides the implicit generic in package ?base?: Classes: "nonstandardGenericFunction", "standardGeneric") Creating a generic for...
2004 Jun 19
0
setGeneric / standardGeneric when args are not "literals" - corrected
This is a correction to my previous message, I forgot to swap two lines in the body of setMakeGenericMethod. Sorry about that. The correct (full message) reads like this: Hi, This works > setGeneric("clear", function(obj) standardGeneric("clear")) [1] "clear" but this doesn't. Why? > funName <- "clear" > setGeneric(funName, function(obj) standardGeneric(funName)) Error in .recursiveCallTest(body, fname) : (converted from warning) The body of the generic function for "clear"...
2005 Dec 29
1
trouble with S4 methods for group "Summary"
...t;track" na.rm = "missing" (inherited from na.rm = "ANY") As you can see from the above, the method I tried to set for "max" (via "Summary") was defined for the formal argument "na.rm" not "x". This makes sense because the standardGeneric created for max only allows methods to be defined for argument "na.rm" > max standardGeneric for "max" defined from package "base" belonging to group(s): Summary function (..., na.rm = FALSE) standardGeneric("max") <environment: 0x19447a28...
2009 Nov 10
1
standardGeneric seems slow; any way to get around it?
Hi, I'm running some routines with standard matrix operations like solve() and diag(). When I do a profile, the lead item under total time is standardGeneric(). Furthermore, solve() and diag() have much greater total time than self time. ??? I assume there is some time-consuming decision going on in the usual functions; is there any way to avoid that and go straight to the calculaions? Thanks John Tillinghast [[alternative HTML version deleted]]
2006 Feb 14
3
S4 classes and methods with optional arguments
Hi, i have used S4 classes to implement a unified access to random number generators (package rstream on CRAN). I have used a construct to allow optional arguments: if(!isGeneric("rstream.sample")) setGeneric("rstream.sample", function(stream,...) standardGeneric("rstream.sample")) setMethod("rstream.sample", c("rstream","numeric"), function(stream,n=1) { ... [ code ] ... } ) Thus if rs is an instance of an rstream object one can a random sample of size 10 using rstream.sample(rs, 10) for a sample of s...
2006 Oct 11
1
dispatching on group generics with more than one formal
...ion: does it really matter what's in the body of the function definition in a 'setGroupGeneric' call? the actual group function definition is always overwritten by a message to the effect the function should not be called directly. __ setGroupGeneric("Foo", function(x) standardGeneric("Foo")) setGroupGeneric("Foo2", function(x, y) standardGeneric("Foo2")) setGeneric("foo", function(x) standardGeneric("foo"), group = "Foo", useAsDefault = function(x) "Default") setGeneric("foo2", function(x, y) stand...
2009 Oct 31
3
Plots with k-means
Hi, I'm doing a k-means cluster with 6 clusters and 15 variables. Any suggestions on how to plot the results? I've tried the standard xy plot, but couldn't get much of it. Thansk in advance, Iuri.
2016 Mar 04
2
as.vector in R-devel loaded 3/3/2016
Er, until _what_ is fixed? I see no anomalies with the version in R-pre: > library(Matrix) > as.vector standardGeneric for "as.vector" defined from package "base" function (x, mode = "any") standardGeneric("as.vector") <environment: 0x7fe8f4516640> Methods may be defined for arguments: x, mode Use showMethods("as.vector") for currently available ones. >...
2009 Jul 16
1
Handling masked methods
...39; The following object(s) are masked from package:test1 : train > train(f, x, y) Error in function (classes, fdef, mtable) : unable to find an inherited method for function "train", for signature "foo", "matrix", "numeric" > test2::train standardGeneric for "train" defined from package "test2" function (object, x, y, ...) standardGeneric("train") <environment: 0x160a22d0> Methods may be defined for arguments: object, x, y Use showMethods("train") for currently available ones. > test1::train stan...
2007 Jan 31
2
Problems with definitions of S4-generics
...er, Simon Urbanek confirmed that the issue is not platform related, and that it is most likely a bug. He suggested to post my report to "the appropriate mailing list" -- I choose r-devel. #### Problem-intro: ## Define two S4-classes setGeneric("foofunc", def=function(object) {standardGeneric("foofunc")}) setGeneric("barfunc", def=function(object) {standardGeneric("barfunc")}) #### Okay, let's start. #### Fist the correct part ## Do some tests to see if the generic is present, ## and have a look at some details isGeneric("foofunc") # [1] TR...
2009 Feb 25
1
Unexpected side effect of the ":::" operator on the value of isGeneric
...the "^^^^^" marked output at the bottom): > library("IRanges") Carico il pacchetto richiesto: 'IRanges' The following object(s) are masked from package:base : cbind, order, pmax, pmax.int, pmin, pmin.int, rbind, rep.int, table > annotation standardGeneric for "annotation" defined from package "IRanges" function (x, ...) standardGeneric("annotation") <environment: 0x1a302b0> Methods may be defined for arguments: x Use showMethods("annotation") for currently available ones. > showMethods("annot...
2010 Sep 03
3
S4 Method Signatures
Hello, If the signature of a method defines which generic it implements then I'm confused about why this minimal example I invented won't work : setGeneric("myFun", function(rs, ...){standardGeneric("myFun")}) setGeneric("myFun", function(cs, ...){standardGeneric("myFun")}) setMethod("myFun", "numeric", function(rs, colour = "Blue") { cat(rs*100, colour) }) setMethod("myFun", "character", function(cs, colour = &...
2005 Jul 20
1
Default arguments for setMethod() (PR#8021)
...ng in the call to the generic function, the default expression in the method is used. If the method definition has no default for the argument, then the expression (if any) supplied in the definition of the generic function itself is used. ****** However: > setGeneric('foo',function(x,y)standardGeneric('foo')) [1] "foo" > setMethod('foo','numeric',function(x,y=3)x+y) [1] "foo" > foo(10) Error in foo(10) : argument "y" is missing, with no default #### BUT adding a NULL default argument in the standardGeneric fixes this: > setGeneric(...
2009 Jun 05
2
Problem with generic methods
...idea why. Any ideas welcome, Rainer > setClass("fun", representation(x = "numeric")) [1] "fun" > new("fun") An object of class ?fun? Slot "x": numeric(0) > setGeneric( "beginYear", function(object, ...) standardGeneric("beginYear") ) setGeneric( + "beginYear", + function(object, ...) standardGeneric("beginYear") + ) [1] "beginYear" > beginYear.Fun = function(x) x^2 > beginYear.Fun(4) [1] 16 > setMethod( "beginYear",...
2008 Mar 13
3
Sealed for setGeneric
Hi the list When two setGeneric occurs on the same function, the second erage the first and erase all the function previously define. Is it possible to prevent that ? Is it possible to declare a setGeneric that can not be erased later ? Something like the |sealed for setMethod...| || |Thanks| || Christophe
2012 Apr 24
2
How do i read the source code of "biplot"?
> biplot standardGeneric for "biplot" defined from package "stats" function (x, ...) standardGeneric("biplot") <environment: 0x0d4444d8> Methods may be defined for arguments: x Use showMethods("biplot") for currently available ones. > > > showMethods("bipl...
2013 Mar 13
1
S4 generic not exported correctly / incorrect dispatch?
...<environment: namespace:graphics> notice that 'plot' is reported as an S3 generic, but should be an S4 generic. Removing Depends: intervals or changing to importsFrom(intervals, "plot") recovers S4 export > library(PkgA) Loading required package: intervals > plot standardGeneric for "plot" defined from package "graphics" function (x, y, ...) standardGeneric("plot") <environment: 0x60aea90> Methods may be defined for arguments: x, y Use showMethods("plot") for currently available ones. The 'intervals' package Depend...