编辑从名称空间加载的函数时出现问题

时间:2019-05-20 11:40:53

标签: r namespaces mlr

我想从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 !

0 个答案:

没有答案