search for: isgenerated

Displaying 20 results from an estimated 54 matches for "isgenerated".

2003 Sep 27
2
does isGeneric work differently in 1.8.0 ?
Hello, the last command (isGeneric) in following R-code (attached) produces different output, depending on wheter 1.8.0 alpha or 1.7.1 is used. Is that to be expected ? Both R Versions were started with option vanilla --------------------------------------------------- R.1.7.1: --------------------------------------------------- > version _ platform i686-pc-linux-gnu arch i686
2012 Mar 07
1
isGeneric() can return an error
Hi, I wonder if this is a feature or a bug: > isGeneric("&&") Error in genericForPrimitive(f) : methods may not be defined for primitive function ?&&? in this version of R > isGeneric(":") Error in genericForPrimitive(f) : methods may not be defined for primitive function ?:? in this version of R According to the man page:
2009 Feb 25
1
Unexpected side effect of the ":::" operator on the value of isGeneric
Hi, when running the following on a fresh R, library("IRanges") annotation showMethods("annotation") Biobase:::annotation showMethods("annotation") I get (see the "^^^^^" marked output at the bottom): > library("IRanges") Carico il pacchetto richiesto: 'IRanges' The following object(s) are masked from package:base :
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",
2007 Mar 29
0
S4 generic surprise
I discovered the following behavior when source'ing the same file repeatedly as I edited it. My generic stopped acting like a generic. I can't tell from the docs what, if any, behavior is expected in this case. R 2.4.0 > foo <- function(object) 3 > isGeneric("foo") [1] FALSE > setMethod("foo", "matrix", function(object) 4) Creating a new
2023 Mar 08
0
Default Generic function for: args(name, default = TRUE)
Dear Gregg, Thank you for the fast response. I believe though that isGeneric works only for S4-functions: isGeneric("plot") # FALSE I still try to get it to work. Sincerely, Leonard On 3/8/2023 9:13 PM, Gregg Powell wrote: > Yes, there is a way to check if a function is generic. You can use the isGeneric function to check if a function is generic. Here's an updated version
2003 Jul 26
2
How to make "<-" generic?
Hi, perhaps a little bit unusual: is it possible to use "<- " as generic function with a new signature? The following example doesn't work: > isGeneric("<-") [1] FALSE > setClass("A",representation(x = "numeric")) [1] "A" > setClass("B",representation(x = "numeric")) [1] "B" > myAssign.A <-
2005 Jun 17
1
(PR#7951) DispatchOrEval missing in do_isfinite and do_isinfinite
Hi, OK, if you try to explicitly make them generic, you are told that they are implicitly already generic: > setGeneric("is.finite", function(from, ...) standardGeneric("is.finite")) Error in setGeneric("is.finite", function(from, ...) standardGeneric("is.finite")) : "is.finite" is a primitive function; methods can be defined, but the
2004 Feb 26
2
package 'stats' needs import directive for 1.9.0?
I maintain the Irregular Time Series (its) package on CRAN. I am currently testing a release. Under 1.8.1 I am able to define a S4 generic 'start' as follows: if(!isGeneric("start")) {setGeneric("start", useAsDefault=start)} Under 1.9.0, Rcmd check generates an error, as 'start' is not recognised. If I use the NAMESPACE directive IMPORT, all is well:
2009 Aug 17
2
S4 Generics and NAMESPACE : justified warning ?
Dear list, It seems that a package (pkgB) using another package (pkgA) with S4 generics formed by taking existing functions (for example 'plot') must not import the existing functions ('plot') in its namespace to avoid the warning "replacing previous import: plot". Suppose we use the simple 'import' directive in the name space of pkgB. pkgA and pkgB files would
2015 Jan 28
2
[Q] Get formal arguments of my implemented S4 method
Interrogating some (of my own) code in another package. >norm.meth <- getMethod("normalize", "MatrixLike") >message("str(norm.meth)") >str(norm.meth) >message("show(norm.meth at .Data)") >show(norm.meth at .Data) Last show() displays this: function (object, ...) { .local <- function (object, method = c("median",
2005 Oct 19
2
Error in opening .RData containing a genefilter object
Hi, I discover that when I save a workspace containing a genefilter (pkg from Bioconductor) object I cannot open no more after. I have to restore the .RData file from a backup to be able to start R again. I didn't upgrade to Version 2.2 but I'm not sure that it will solve the problem. Did anyone have encounter the same problem? Below is a short r session to reproduce the error: ...
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 May 20
1
S4 generic for lowess
Hi, A lowess method is defined in our package for one of our S4 classes. To explicitely define the generic this is being used if (!isGeneric("lowess")) setGeneric("lowess", useAsDefault = lowess) This works fine for many other methods inherited from various R packages. In this case a warning is issued in R CMD check: * checking R code for possible problems ... NOTE
2006 May 22
2
confused by inheritance...
Hi r-devels, I am stuck in some S4 inheritance problem: setClass("A",representation(a="numeric")) setClass("A1",representation(b="numeric"),contains="A") setClass("A2",representation(c="numeric"),contains="A1") if(!isGeneric("foo")){ setGeneric("foo", function(x,y,z, ...)
2004 Jan 08
3
S3, S4, namespace
I have encountered an issue which I have been unable to resolve, involving an S3 generic (print) being declared S4 generic in a package, and the method being exported. This all works fine - the problem occurs when I try to import the method to another package. Here is the bit that works fine. ------------- #the .r file for package bar
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
2007 Jan 31
2
Problems with definitions of S4-generics
Hello all, I'd like to report a problem related to S4 classes. Platform: Mac G4/400 PCI (PPC-architecture) Mac OS 10.4.8 R 2.4.1 for Mac OS X (CRAN binary, 2006-12-19) w/ R.app 1.18 Last December, 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.
2010 Jan 11
1
Problem with S4 generic function print
First, if I have an S4 class boo should I define S3 method for printing print.boo(..) or should I define S4 method print(..). I mainly need to define print function only because some user might call it and then I would like to dispatch the call to right function instead. Second, it seems that by defining S4 generic function print, it is possible to break argument hinting on the status bar.
2024 Mar 13
1
Spurious warning in as.data.frame.factor()
? Tue, 12 Mar 2024 12:33:17 -0700 Herv? Pag?s <hpages.on.github at gmail.com> ?????: > 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)) > ???