search for: existsmethod

Displaying 4 results from an estimated 4 matches for "existsmethod".

2007 Nov 14
1
test for existance of a method for given class
...r a method exists for given object. For example, whether a function "deviance" is defined for an object of the "lm" class. My imperfect understanding leads me to think something like hasMethod("deviance", object) hasMethod("deviance", "lm") existsMethod("deviance", signature(class="lm")) or similar might work (I don't fully understand how to manipulate signatures), but all the variations on this I have tried return FALSE. (Except, interestingly, when I first load library lme4, after which all return TRUE even for non-ex...
2011 Aug 23
1
Implementing a "plugin" paradigm with R methods
...function(src, link, plugin, ...){ out <- gsub("[[:digit:]]", "", src) return(out) } ) setMethod(f="foo", signature=signature(src="character"), function(src, plugin=NULL, ...){ if(!is.null(plugin)){ if(!existsMethod(f="plugin", signature=c(src=class(src), link="foo", plugin=plugin) )){ stop("Invalid plugin") } .plugin <- selectMethod( "plugin", signature=c(src=cl...
2001 Apr 23
1
several bugs (PR#918)
...objip("exists") $splus: [1] "exists" "existsFunction" "file.exists" $main: [1] "dbexists" "dbexistsOld" "dyn.exists" "existsClass" [5] "existsClassDef" "existsDoc" "existsMethod" Can you add these function names to R with sensible defaults until the S4 methods are fully in place? b. S-Plus 6 uses the function oldClass Can you add these functions and default definitions to R? oldClass <- function(...) class(...) "oldClass<-" <- function(....
2008 Mar 30
1
package.skeleton.S4
...ges({ sapply(list,function(item){ promptClass(item,filename = file.path(docs_dir, sprintf("%s.Rd",list0[item]))) }) listMethod <- unclass(getGenerics()) sapply(listMethod,function(metho){ if(any(sapply(list,function(lis){existsMethod(metho,lis)}))){ promptMethods(metho,filename = file.path(docs_dir, sprintf("%s.Rd",metho))) }else{} return(invisible()) }) })) if (inherits(yy, "try-error")){stop(yy)}else{} if (length(list.files...