search for: getgeneric

Displaying 20 results from an estimated 66 matches for "getgeneric".

Did you mean: setgeneric
2006 Sep 23
1
generics for primitive functions
i think these two code snippets exhibit a bug. they are identical but for the inclusion of an initial line in snippet [2] [1] setMethod("Math", signature(x = "numeric"), function(x) "Works") getGeneric("sqrt")(4) [2] getGeneric("sqrt")(4) setMethod("Math", signature(x = "numeric"), function(x) "Works") getGeneric("sqrt")(4) these are my results, when each is run from a fresh R session [1] > setMethod("Math", signature(x...
2006 Sep 22
1
Possible bug in base::namespaceImportFrom?
Hi, namespaceImportFrom in base/R/namespace.R has the following: fdef <- methods:::getGeneric(genName, impenv) The definition of getGeneric is in methods/R/RMethodUtils.R starts with: getGeneric <- ## return the definition of the function named f as a generic. ## ## If there is no definition, throws an error or returns ## NULL according to the value of mustF...
2003 Oct 13
2
Infinite recursion in getGeneric (PR#4561)
> setClass('foo') [1] "foo" > setMethod('is.logical', 'foo', function(x) TRUE) [1] "is.logical" > getGeneric('is.integer') Error in options(x) : evaluation is nested too deeply: infinite recursion? > --please do not edit the information below-- Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu system = i686, linux-gnu status = major = 1 minor = 8.0 year = 2003...
2004 Jun 26
1
S4 group "Math", "getGroupMembers", "genericForPrimitive"
...: The S4 group "Math" doesn't work as documented; i.e., "log", "log10", "gamma" and "lgamma" are included in the documentation but don't work. See example code below. Moreover, what about 'genericForPrimitive' which is used in 'getGeneric'. It seems that this method is not included in the R Version 1.9.1 (also 1.9.0). See the example code of John Chambers at the end of this email. Why not add the method 'getGroupMembers' as proposed by John Chambers to the methods package? (see reply to mail: "Missing 'getGroup...
2014 Nov 25
0
problem with setGroupGeneric from package methods
...parentenv, handlers) 5: tryCatchOne(expr, names, parentenv, handlers[[1]]) 6: doTryCatch(return(expr), name, parentenv, handler) 7: loadNamespace(package, c(which.lib.loc, lib.loc)) 8: methods:::cacheMetaData(ns, TRUE, ns) 9: .updateMethodsInTable(fdef, where, attach) 10: .updateMethodsInTable(getGeneric(g), where, attach) 11: .setupMethodsTables(generic) ============================================== On a different Linux machine and R version (the standard faculty wide installation), library(pctsData) completes fine but package "grgen" mentioned above still gives the error at installa...
2016 Mar 04
2
as.vector in R-devel loaded 3/3/2016
I see as below, where getGeneric and getMethod imply a different signature; the signature is mode="any" for both cases in R version 3.2.3 Patched (2016-01-28 r70038)I don't know how to reproduce Jeff's error, though. > library(Matrix) > as.vector function (x, mode = "any") .Internal(as.vector(x,...
2005 Jan 13
3
as.character methods
...ic only if "..." is an argument to the generic Am I reading the documentation incorrectly? How do I correctly pass the ... object to the method for this "tmp" object? However I note that looking at the generic function, I see no mention of ... (despite the documentation). > getGeneric("as.character") standardGeneric for "as.character" defined from package "base" function (x) standardGeneric("as.character", .Primitive("as.character")) <environment: 0145EDC4> Methods may be defined for arguments: x So, briefly, is the do...
2005 Jan 13
3
as.character methods
...ic only if "..." is an argument to the generic Am I reading the documentation incorrectly? How do I correctly pass the ... object to the method for this "tmp" object? However I note that looking at the generic function, I see no mention of ... (despite the documentation). > getGeneric("as.character") standardGeneric for "as.character" defined from package "base" function (x) standardGeneric("as.character", .Primitive("as.character")) <environment: 0145EDC4> Methods may be defined for arguments: x So, briefly, is the do...
2003 Oct 15
2
help.search in trouble with R-patched ?
...mpt", agrep=F) Error: couldn't find function ".class1" > traceback() 12: initialize(value, ...) 11: initialize(value, ...) 10: new("ObjectsWithPackage", value, package = pkg) 9: metaNameUndo(unique(these), prefix = "M", searchForm = searchForm) 8: methods:::getGenerics(ns) 7: unique(c(methods:::getGenerics(ns), methods:::getGenerics(parent.env(ns)))) 6: loadNamespace(name) 5: getNamespace(ns) 4: asNamespace(ns) 3: getExportedValue(pkg, name) 2: tools::fileTest 1: help.search("prompt", agrep = F) > version _ platform i686-pc-linux-gnu arch...
2018 Jun 07
2
[lld] ObjFile::createRegular is oblivious of PendingComdat
...+++ b/COFF/InputFiles.cpp @@ -229,11 +229,11 @@ Symbol *ObjFile::createRegular(COFFSymbolRef Sym) { if (Sym.isExternal()) { StringRef Name; COFFObj->getSymbolName(Sym, Name); - if (SC) + if (SC && SC != PendingComdat) return Symtab->addRegular(this, Name, Sym.getGeneric(), SC); return Symtab->addUndefined(Name, this, false); } - if (SC) + if (SC && SC != PendingComdat) return make<DefinedRegular>(this, /*Name*/ "", false, /*IsExternal*/ false, Sym.getGeneric(), SC); return nullptr; I ca...
2009 Dec 30
1
seg-fault... but on what
I got the following after running succesfully through this loop 28 million times... the loop opens text files in a directory and inserts line by line into a database... *** caught segfault *** address 0xc0000010, cause 'memory not mapped' Traceback: 1: .getGeneric(f, where, package) 2: getGeneric("coerce", where = where) 3: as(obj, "integer") 4: mysqlConnectionInfo(dbObj, ...) 5: dbGetInfo(conn, "rsId") 6: dbGetInfo(conn, "rsId") 7: dbListResults(con) 8: dbListResults(con) 9: mysqlQuickSQL(conn, statement, ...)...
2007 Jan 31
2
Problems with definitions of S4-generics
...] # <environment: R_GlobalEnv> foofunc # nonstandardGenericFunction for "foofunc" defined from package ".GlobalEnv" # # function (object) # { # standardGeneric("foofunc") # } # <environment: 0x293bbb8> # Methods may be defined for arguments: object getGeneric("foofunc") # same result as above #### Now what I suspect is a bug ## Delete the S4-generic and repeat the "forensic" test calls removeGeneric("foofunc") # [1] TRUE ## The following is as expected... foofunc # Fehler: objekt "foofunc" nicht gefunden [~...
2018 Jun 07
2
[lld] ObjFile::createRegular is oblivious of PendingComdat
...*ObjFile::createRegular(COFFSymbolRef Sym) { >> if (Sym.isExternal()) { >> StringRef Name; >> COFFObj->getSymbolName(Sym, Name); >> - if (SC) >> + if (SC && SC != PendingComdat) >> return Symtab->addRegular(this, Name, Sym.getGeneric(), SC); >> return Symtab->addUndefined(Name, this, false); >> } >> - if (SC) >> + if (SC && SC != PendingComdat) >> return make<DefinedRegular>(this, /*Name*/ "", false, >> /*IsExternal*/...
2001 Nov 13
0
Method dispatch in C for primitive functions
...t of a trick to find the formal argument list, since R currently just returns NULL for args(f) if f is a primitive. (We may need to make some change here.) Two that are worth noting are "[" and "[[" (and the corresponding "[<-" and "[[<-"): > args(getGeneric("[")) function (x, i = NULL, j = NULL, ..., drop = TRUE) NULL > args(getGeneric("[[")) function (x, i = NULL, ...) NULL The i,j arguments are there so we can, e.g., define methods that dispatch on the column argument for data-frame-like objects in the future. If you'r...
2006 May 02
0
methods for @ operator
...or. i attempted to do this as I have done it for infix operators like '+' , but am not meeting with success. i am pretty sure this is because '+' has a predefined generic with "dispatchable" formals e1 and e2, whereas no generic is predefined for '@' > getGeneric("+") standardGeneric for "+" defined from package "base" belonging to group(s): Arith function (e1, e2) standardGeneric("+", .Primitive("+")) <environment: 0x169dea44> Methods may be defined for arguments: e1, e2 > getGeneric("@&...
2007 Jul 03
1
How to get the names of the classes exported by a specific package.
Hi, I'm writing some functions to generate Rd files for a S4 package. I want to have 2 character vectors with the names of the S4 classes and the methods exported by a package. To get the info about methods I'm using "getGenerics(where="package:FLCore")" however I can not find a similar process to get the S4 classes. Are there functions to access this information ? Best and thanks EJ
2009 Nov 25
1
group generics
...uot;, signature=c("numeric", "A"))(e1, e2) print(v) new("B", v, xb=e1*e2 at xb) } ) Results: > t1 <- new("B", new("A", xa=4), xb=2) > t1 An object of class ?B? Slot "xb": [1] 2 Slot "xa": [1] 4 > 3*t1 Error in getGeneric(f, !optional) : no generic function found for "callGeneric" Thanks. Ross Boylan
2011 Mar 01
1
changes in recent R-devel revisions?
Hi, I have a BioC infra-structure package that works fine (I can build, check and load it successfully) on revision r53950. The very same package fails on r54591 with the error below: Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : cyclic name space dependency detected when loading ?oligoClasses?, already loading ?oligoClasses? I don't see anything
2006 Dec 01
2
promptClass misses methods
...itialize (package methods) .Object="mspathCoefficients" (inherited from: .Object="ANY") Function: print (package base) x="mspathCoefficients" Function: show (package methods) object="mspathCoefficients" (inherited from: object="ANY") > getGeneric("print") standardGeneric for "print" defined from package "base" function (x, ...) standardGeneric("print") <environment: 0x84f2d88> Methods may be defined for arguments: x I've looked through the code for promptClass, but nothing popped out at...
2011 Nov 09
1
Define S4 methods for 'plot'
...masked from 'package:graphics': plot. And then, I cannot use the classical function plot: plot on object 'A' works, but plot(1) does not. I try, reading some recent post on r-devel to remove the line 'setGeneric' but it does not works (which does not surprise me since getGeneric("plot") gives a NULL results). Any idea of what goes wrong? Christophe -- View this message in context: http://r.789695.n4.nabble.com/Define-S4-methods-for-plot-tp4020750p4020750.html Sent from the R devel mailing list archive at Nabble.com.