Learn R Programming

mvbutils (version 2.5.4)

hack: Modify standard R functions, including tweaking their default arguments

Description

You probably shouldn't use these...

Usage

hack( fun, ...)
 assign.to.base( x, what=,  where=-1, in.imports=, override.env = TRUE)

Arguments

fun
a function (not a character string)
...
pairlist of arguments and new default values, e.g. arg1=1+2. Things on RHS of equal signs will not be evaluated.
x
function name (a character string)
what
function to replace x, defaulting to "replacement." %&% x
where
where to find the replacement function, defaulting to usual search path
in.imports
usually TRUE, if this is being called from an .onLoad method in a namespace. Make sure any copies of the function to be changed that are in the "imports" namespace also get changed. See Description.
override.env
should the replacement use its own environment, or (by default) the one that was originally there?

code

<<-< code="">

pkg

mvbutils

emph

directly

Examples

Run this code
hack( dir, all.files=getOption( "ls.all.files", TRUE)) # from my '.First'
assign.to.base( "dir", hack( dir, all.files=TRUE))

Run the code above in your browser using DataLab