简体   繁体   English

尝试在 200 台机器上系统地安装 R,有时需要单独使用 RTools,有时则不需要。 为什么?

[英]Trying to install R systematically across 200 machines, sometimes RTools is required separately, other times it is not. Why?

I am trying to onboard a team of 200 people onto a tool that uses R to move data from Excel to a database.我正在尝试将一个 200 人的团队加入一个工具,该工具使用 R 将数据从 Excel 移动到数据库。 I walk the team through the following steps:我带领团队完成以下步骤:

  1. Download R from the closest cran mirror and install in program files从最近的 cran 镜像下载 R 并安装在程序文件中
  2. Download R studio and install RStudio (wherever it defaults to)下载 R studio 并安装 RStudio (默认位置)
  3. Open RStudio and run the following code:打开 RStudio 并运行以下代码:
List.of.Packages = c("car",              ### <-- Regression analyses
                     "corrplot",         ### <-- Plots correlation matrices
                     "plyr",             ### <-- Basic data cleaning
                     "dplyr",            ### <-- Basic data cleaning for dataframes
                     "filesstrings",     ### <-- Moves/manipulates files
                     "httr",             ### <-- Facilitates HTTP calls
                     "jsonlite",         ### <-- Manipulate json data
                     "lubridate",        ### <-- Allows for easier manipulation of dates
                     "tidyr",            ### <-- Data cleaning methods
                     "zoo",              ### <-- Aggregate functions
                     "methods",          ### <-- Runs R through terminal
                     "RDCOMClient",      ### <-- Interact with Outlook from R
                     "stringr",          ### <-- Easier manipulation of Strings
                     "openxlsx",         ### <-- Read/write from/to Excel
                     "XML",              ### <-- Manipulates XML data
                     "rjson",            ### <-- Manipulation of json data
                     "purrr",            ### <-- Enhanced exploration of functions and vectors
                     "listviewer",       ### <-- Enhanced exploration of lists
                     "xlsx",             ### <-- Enhanced exploration of lists
                     "rvest")            ### <-- "Harvest" (Webscraping and API utilities)

New.Packages = List.of.Packages[!(List.of.Packages %in% installed.packages()[,"Package"])]

if(length(New.Packages)) install.packages(New.Packages, repos = "http://cran.rstudio.com/")

At this point, some users get Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding...此时,部分用户获取Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding... Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding... but others do not. Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding...但其他版本则不然。

I understand and have seen all the posts related to how to install Rtools.我了解并看过所有与如何安装 Rtools 相关的帖子。 But what I'm asking here is... how can this not be consistent?但我在这里要问的是......这怎么可能不一致? Why would the same installation process and the same code require some people to take an extra step while others did not have to?为什么相同的安装过程和相同的代码需要一些人采取额外的步骤,而其他人则不需要? Is there some configuration part of the install that also installs Rtools that some people might not be including?安装的某些配置部分是否还安装了某些人可能不包括的 Rtools? How can I make this onboarding process repeatable?我怎样才能使这个入职过程可重复?

As @Chr mention the requirement is a result of the user deciding to install the most recent version from source.正如@Chr 提到的,该要求是用户决定从源代码安装最新版本的结果。

There are 2 options to use to fix this:有 2 个选项可用于解决此问题:

  • Add this option to the install.packages command: type="binary"将此选项添加到 install.packages 命令:type="binary"
  • Or the safer option is run options(install.packages.check.source = "no") .或者更安全的选项是 run options(install.packages.check.source = "no") This will suppressed the check and not provide the option to install from source.这将抑制检查并且不提供从源安装的选项。

See ?install.packages for more detail discussion.有关详细讨论,请参阅?install.packages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM