本文介绍了一次分离多个包裹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
受this answer的启发,我正在寻找一种同时分离多个包的方法.
Inspired by this answer I am looking for a way to detach several packages at once.
当我加载时说 Hmisc,
When I load say Hmisc,
# install.packages("Hmisc", dependencies = TRUE)
require(Hmisc)
R
还加载 survival
和 splines
.我的问题是是否有办法一起卸载该组?
R
also loads survival
and splines
. My question is if there is a way to unload that group together?
我目前正在做这样的事情,
I currently do something like this,
detach(package:Hmisc, unload = T)
detach(package:survival, unload = T)
detach(package:splines, unload = T)
我试过了,
detach(package:c('Hmisc', 'survival', 'splines'), unload = T)
…
推荐答案
另一种选择:
Vectorize(detach)(name=paste0("package:", c("Hmisc","survival","splines")), unload=TRUE, character.only=TRUE)
这篇关于一次分离多个包裹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!