簡體   English   中英

嘗試在 200 台機器上系統地安裝 R,有時需要單獨使用 RTools,有時則不需要。 為什么?

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

我正在嘗試將一個 200 人的團隊加入一個工具,該工具使用 R 將數據從 Excel 移動到數據庫。 我帶領團隊完成以下步驟:

  1. 從最近的 cran 鏡像下載 R 並安裝在程序文件中
  2. 下載 R studio 並安裝 RStudio (默認位置)
  3. 打開 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/")

此時,部分用戶獲取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 相關的帖子。 但我在這里要問的是......這怎么可能不一致? 為什么相同的安裝過程和相同的代碼需要一些人采取額外的步驟,而其他人則不需要? 安裝的某些配置部分是否還安裝了某些人可能不包括的 Rtools? 我怎樣才能使這個入職過程可重復?

正如@Chr 提到的,該要求是用戶決定從源代碼安裝最新版本的結果。

有 2 個選項可用於解決此問題:

  • 將此選項添加到 install.packages 命令:type="binary"
  • 或者更安全的選項是 run options(install.packages.check.source = "no") 這將抑制檢查並且不提供從源安裝的選項。

有關詳細討論,請參閱?install.packages

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM