我想从mlr软件包中临时修改 selectFeatures 功能。但是,当我尝试执行此操作(使用 assignInNamespace 函数)时会出错,因为 selectFeatures 从未按我的意愿进行修改(请参见下面的代码)。发生了什么事?
注意: reassignInPackage 函数也没用
library(mlr)
assignInNamespace("selectFeatures",function(){},"mlr")
getFromNamespace("selectFeatures","mlr") #selectFeatures in mlr namespace seems modified
selectFeatures #Shows the initial selectFeatures function !
environment(selectFeatures) #Shows that selectFeatures is in mlr namespace, so it should be modified !