How can I prevent R from loading a package?

后端 未结 2 1009
我寻月下人不归
我寻月下人不归 2021-01-05 05:57

I am using the multicore package in R for parallelizing my code. However, if the tcltk package is loaded, forking processes with the multicore package will cause R to hang i

2条回答
  •  余生分开走
    2021-01-05 06:14

    Another way to avoid loading a particular package as a dependency is, based on the assumption that none of the functions you require depend on that package, would be to reference the functions you need using their namespace:

    lattice::xyplot(1~1)
    

    This way, you don't need to load the package with your function, and you don't inadvertently load the problem package.

提交回复
热议问题