问题来源
今天安装clusterProfiler包的时候出现这样的报错
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :
找不到对象'get_fun_from_pkg'
错误: unable to load R code in package ‘clusterProfiler’
停止执行
ERROR: lazy loading failed for package ‘clusterProfiler’
* removing ‘/home/XXX/software/R.3.6/bin/lib64/R/library/clusterProfiler’
解决思路
把错误关键词get_fun_from_pkg往搜索引擎里贴一下
显示的版本是0.1.8。所以我检查了一下已经安装的rvcheck版本:
> packageVersion("rvcheck")
[1] ‘0.2.1’
版本太新了?新的版本里没有get_fun_from_pkg?于是我尝试把rvcheck版本降到0.1.8:
关于如何把rvcheck版本降到0.1.8,我的方法是:
>remove.packages("rvcheck") ## 先卸载这个包
从‘/home/XXX/software/R.3.6/bin/lib64/R/library’中删除程序包
(因为没有指定‘lib’)
更新'.Library'里的HTML程序包列表
Making 'packages.html' ... 做完了。
>require(devtools) #加载
载入需要的程辑包:devtools
载入需要的程辑包:usethis
>install_version("rvcheck", version = "0.1.8",repos = ""http://cran.us.r-project.org")
Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/rvcheck/rvcheck_0.1.8.tar.gz
* installing *source* package ‘rvcheck’ ...
** 成功将‘rvcheck’程序包解包并MD5和检查
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rvcheck) 安装成功
> packageVersion("rvcheck")
[1] ‘0.1.8’
#再检查一下,确认rvcheck版本为0.1.8
重新安装clusterProfiler,没有报错,那就成功安装clusterProfiler了!开心~~~~~~
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------I'm a line ! Thanks !---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------