R语言问题积累

R安装Github包

2020-01-02  本文已影响0人  欧阳松

一、代码安装:

1.R安装devtools包或者remotes包,这两个包安装语句基本一样
install.packages("devtools")
install.packages("remotes")
2.安装github上的R包(需翻墙或改hosts)
devtools::install_github('lchiffon/REmap')
#q前为github的用户名,后为包名
3.测试
library(REmap)

二、本地安装

github.com上直接下载xx-master.zip,然后可以这样安装

remotes::install_local("D:/nCov2019-master.zip",upgrade = F,dependencies = T)

也可以将zip文件解压成文件夹XX-master,输入命令

install.packages("D:/nCov2019-master",repos=NULL,type="source")

* installing *source* package 'nCov2019' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'nCov2019'
    finding HTML links ... 好了
    get_nCov2019                            html  
    load_nCov2019                           html  
** 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 (nCov2019)

三、镜像安装

打不开Github,可以用镜像源安装,比如https://hub.fastgit.org/

devtools::install_git('https://hub.fastgit.org/lchiffon/REmap')

四、码云安装

申请一个码云gitee账号,然后直接从github导入到gitee仓库

remotes::install_git('https://gitee.com/你的用户名/你的仓库名')
上一篇下一篇

猜你喜欢

热点阅读