I basically want to change a non-visible function of a package. For visible functions, i.e. functions that have no asterix when methods
is called on them, I fou
Use fixInNamespace
. :)
fixInNamespace("predict.ar", "stats")
or
fixInNamespace("predict.ar", pos="package:stats")
(Several years later...)
From Nicholas H's comment: if you want to push some code to CRAN that depends upon an internal function from another package, it will throw a build warning and be rejected by R-core. If you want that internal function, you should just take a copy of it using the :::
operator and maintain it yourself.
predict.ar <- stats:::predict.ar