Skip to content
Prev 8364 / 12125 Next

[R-pkg-devel] Dispatch for S3 and Ordinary Function with Same Name

Good day,

If there is a function named predict in my package and another in another package, such as randomForest, which is also called in a particular wrapper function in my package, how may I ensure that the call to predict inside of the wrapper function will call randomForest's prediction function and not the predict function defined elsewhere in my package? To illustrate

randomForestPredictInterface <- function(forest, measurementsTest, ...)
{
  predictions <- predict(forest, measurementsTest) # Currently, executes predict defined in my package.

--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia