由于研究需要,需要使用下面文章作者开发的bioage包,但是安装总是出现大大小小的问题。这篇文章用以分享自己的安装经验,大家也可以一起交流交流出现的问题。
文章出处:
Kwon, D., Belsky, D.W. A toolkit for quantification of biological age
from blood chemistry and organ function test data: BioAge. GeroScience
43, 2795–2808 (2021). https://doi.org/10.1007/s11357-021-00480-5
首先,R包安装有很多种方式,Bioage包也可以有两种安装方式。
第一种是在线安装。由于github是外网,我在的区域总会出现加载不出来页面或者拒绝访问的情况,在安装时也总会出现连接不上的报错,所以我就采用了第二种安装方式。
在线安装的地址(https://github.com/dayoonkwon/BioAge)
第二种为本地安装。首先去(https://github.com/dayoonkwon/BioAge)本链接下载好zip包。接着按照以下步骤即可安装:
##防止后续各种问题,先更新R版本##
install.packages("installr")
library(installr)
updateR()
##安装相关依赖包##
install.packages("devtools")
install.packages("RCurl")
install.packages("flexsurv")
install.packages("survey")
library(remotes)
library(flexsurv)
library(survey)
##安装bioage包##
#方式一:在线安装
devtools::install_github("dayoonkwon/BioAge")
#方式二:下载后(https://github.com/dayoonkwon/BioAge) ,本地安装
install_local("F:/tutor/Research/技术×机会不平等/代码/bioage/BioAge-master.zip",dependencies = F)
在安装相关依赖包时可能出现安装不上的情况,只需要重复操作几次就能安装上。
这样就能安装好啦~~