Rstudio中包的安装

问题:本来想在Rstudio中用devtools::install_github("microly/alimap")安装下载中国地图数据,结果在安装包的时候碰到了诸多问题,这里就常见问题的解决方法说明如下:

安装devtools包,install.packages("devtools")提示

可能是找不到这个包,这里在Rstudio中——tools——global option——更改包的下载位置为国内清华源,问题解决。

 然后继续进行安装,又发现Rtools工具没有安装。

 这里需要到https://cran.r-project.org/bin/windows/Rtools/Rtools35.exe官网上下载,安装,并配置环境。

Rtools不能通过常规install.packages()命令进行安装,需要通过installr包进行安装,这里选择installr工具帮助下载软件’

  1. install.packages("installr")
  2. install.packages("stringr") ###依赖包 
  3. library(stringr)
  4. library(installr)
    注:其他的GUI (Such As: R, 'Rtools', 'RStudio', 'Git', and More!)都能通过installr进行安装

    安装Rtools

    输入install.Rtools(page_with_download_url = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/Rtools/")

    ·

原文地址:https://www.cnblogs.com/suncf/p/12323427.html