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

Dario Strbenac d@tr7320 @end|ng |rom un|@@ydney@edu@@u
Mon Aug 29 17:00:04 CEST 2022


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


More information about the R-package-devel mailing list