search for: newgsource

Displaying 1 result from an estimated 1 matches for "newgsource".

2006 Oct 27
1
Overloading functions
...a function g. Function f is in a library and g has a default stub in the library but will be mainly overloaded in a later R script. For example: ########## In a compiled package 'P' ################# g <- function() { cat("Original function g"); } f <- function( newGsource=NULL ) { if( is.null(newGsource) == FALSE ) { source( newGsource ); # load new function g } g(); return(1); } ##################################################### If I call f() then I get "Original function g". But I want to overload g so I do the following in the...