Displaying 12 results from an estimated 12 matches for "deriveddefaultmethod".
2024 Mar 13
1
Spurious warning in as.data.frame.factor()
...e():
- bdy[[2L]] <- quote(if((sys.nframe() <= 1L || !identical(sys.function(-1L), as.data.frame)))
+ bdy[[2L]] <- quote(if((sys.nframe() <= 1L || !(
+ identical(sys.function(-1L), as.data.frame) || (
+ .isMethodsDispatchOn() &&
+ methods::is(sys.function(-1L), 'derivedDefaultMethod') &&
+ identical(
+ sys.function(-1L)@generic,
+ structure('as.data.frame', package = 'base')
+ )))))
.Deprecated(
msg = gettextf(
"Direct call of '%s()' is deprecated. Use '%s()' or
'%s()' instead",
The patch p...
2013 Jul 02
2
cache most-recent dispatch
...r.org/packages/release/bioc/html/IRanges.html)
removeGeneric("paste")
library(IRanges)
showMethods(paste)
## Function: paste (package BiocGenerics)
## ...="ANY"
## ...="Rle"
selectMethod(paste, "ANY")
## Method Definition (Class "derivedDefaultMethod"):
##
## function (..., sep = " ", collapse = NULL)
## .Internal(paste(list(...), sep, collapse))
## <environment: namespace:base>
##
## Signatures:
## ...
## target "ANY"
## defined "ANY"
microbenchmark(fun0(lst), fun...
2023 Nov 08
1
Problem in R code
...:
Error in .cellValues(x, y, ...) : unused arguments (fun =
new("standardGeneric", .Data = function (x, ...) standardGeneric("mean"),
generic = "mean", package = "base", group = list(), valueClass =
character(0), signature = "x", default = new("derivedDefaultMethod", .Data
= function (x, ...) UseMethod("mean"), target = new("signature", .Data =
"ANY", names = "x", package = "methods"), defined = new("signature", .Data
= "ANY", names = "x", package = "methods"), gene...
2024 Mar 14
1
Spurious warning in as.data.frame.factor()
...<- quote(if((sys.nframe() <= 1L || !identical(sys.function(-1L), as.data.frame)))
> + bdy[[2L]] <- quote(if((sys.nframe() <= 1L || !(
> + identical(sys.function(-1L), as.data.frame) || (
> + .isMethodsDispatchOn() &&
> + methods::is(sys.function(-1L), 'derivedDefaultMethod') &&
> + identical(
> + sys.function(-1L)@generic,
> + structure('as.data.frame', package = 'base')
> + )))))
> .Deprecated(
> msg = gettextf(
> "Direct call of '%s()' is deprecated. Use '%s()' or
> ...
2024 Mar 14
1
Spurious warning in as.data.frame.factor()
...r other people wanting to add a regression
test to their patch. I see that tests/reg-tests-1e.R is already running
under options(warn = 2), so if I add the following near line 750
("Deprecation of *direct* calls to as.data.frame.<someVector>")...
# Should not warn for a call from a derivedDefaultMethod to the raw
# S3 method -- implementation detail of S4 dispatch
setGeneric('as.data.frame')
as.data.frame(factor(1))
...then as.data.frame will remain an S4 generic. Should the test then
rm(as.data.frame) and keep going? (Or even keep the S4 generic?) Is
there any hidden state I may be brea...
2005 Nov 14
1
Tidiest way of modifying S4 classes?
...Slots, prototype of class "function"
Extends: "OptionalFunction", "PossibleMethod"
Known Subclasses:
Class "MethodDefinition", from data part
Class "genericFunction", from data part
Class "functionWithTrace", from data part
Class "derivedDefaultMethod", by class "MethodDefinition"
Class "MethodWithNext", by class "MethodDefinition"
Class "SealedMethodDefinition", by class "MethodDefinition"
Class "standardGeneric", by class "genericFunction"
Class "nonstandardGeneric...
2024 Mar 15
2
Spurious warning in as.data.frame.factor()
...ession
> test to their patch. I see that tests/reg-tests-1e.R is already running
> under options(warn = 2), so if I add the following near line 750
> ("Deprecation of *direct* calls to as.data.frame.<someVector>")...
> # Should not warn for a call from a derivedDefaultMethod to the raw
> # S3 method -- implementation detail of S4 dispatch
> setGeneric('as.data.frame')
> as.data.frame(factor(1))
> ...then as.data.frame will remain an S4 generic. Should the test then
> rm(as.data.frame) and keep going? (Or even keep the S4 gene...
2024 Mar 15
1
Spurious warning in as.data.frame.factor()
...gt; test to their patch. I see that tests/reg-tests-1e.R is already running
>> under options(warn = 2), so if I add the following near line 750
>> ("Deprecation of *direct* calls to as.data.frame.<someVector>")...
>> # Should not warn for a call from a derivedDefaultMethod to the raw
>> # S3 method -- implementation detail of S4 dispatch
>> setGeneric('as.data.frame')
>> as.data.frame(factor(1))
>> ...then as.data.frame will remain an S4 generic. Should the test then
>> rm(as.data.frame) and keep going? (Or e...
2015 Jan 23
1
:: and ::: as .Primitives?
...ense (human reader or R interpreter)? In either
> case I'm not convinced.
From a developer perspective, especially when debugging, when we do
selectMethod("match", ...) and it turns out that this returns the
default method, it's good to see:
Method Definition (Class "derivedDefaultMethod"):
function (x, table, nomatch = NA_integer_, incomparables = NULL,
...)
base::match(x, table, nomatch = nomatch, incomparables = incomparables,
...)
<environment: namespace:BiocGenerics>
Signatures:
x table
target "DataFrame"...
2024 Mar 12
1
Spurious warning in as.data.frame.factor()
Hi,
The acrobatics that as.data.frame.factor() is going thru in order to
recognize a direct call don't play nice if as.data.frame() is an S4
generic:
??? df <- as.data.frame(factor(11:12))
??? suppressPackageStartupMessages(library(BiocGenerics))
??? isGeneric("as.data.frame")
??? # [1] TRUE
??? df <- as.data.frame(factor(11:12))
??? # Warning message:
??? # In
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
2015 Jan 22
5
:: and ::: as .Primitives?
On Thu, Jan 22, 2015 at 11:44 AM, <luke-tierney at uiowa.edu> wrote:
>
> For default methods there ought to be a way to create those so the
> default method is computed at creation or load time and stored in an
> environment.
We had considered that, but we thought the definition of the function
would be easier to interpret if it explicitly specified the namespace,
instead of