I made some ad hoc modifications to a function in the package metafor
by copying the function code from Github and replacing the function in my environment as described here:
my.rma.uni = function(...) {
# here I simply copied the existing code with no modifications as a test
}
unlockBinding("rma.uni", as.environment("package:metafor"))
assign("rma.uni", rma.uni_mm, as.environment("package:metafor"))
lockBinding("rma.uni", as.environment("package:metafor"))
But when I try to now to run rma.uni
, my modified version appears unable to find metafor
's other internal functions:
Error in .chkdots(ddd, c("knha", "scale", "link", "outlist")) :
could not find function ".chkdots"
I also tried simply calling my.rma.uni
directly (which would actually be my preference so that I can have both the standard rma.uni
and my version available at the same time), but this yields the same error.
How can I ensure that my modified function can access all the internal functions?