从 GitHub 安装 RSelenium

Installing RSelenium from GitHub

我想为 R 使用 RSelenium,但它已从 CRAN 中删除。我决定使用 GitHub 中的 download/installation 遵循指南,但我收到一条无法解释的错误消息。

devtools::install_github("ropensci/RSelenium")

R 开始下载

Downloading GitHub repo ropensci/RSelenium@master
These packages have more recent versions available.
Which would you like to update?

1: All                             
2: CRAN packages only              
3: None                            
4: XML (3.98-1.20 -> 3.99-0) [CRAN]

Enter one or more numbers, or an empty line to skip updates:

我输入 1,因为我想更新所有内容。

XML        (3.98-1.20 -> 3.99-0) [CRAN]
wdman      (NA        -> 0.2.4 ) [CRAN]
binman     (NA        -> 0.1.1 ) [CRAN]
subprocess (NA        -> 0.8.3 ) [CRAN]
semver     (NA        -> 0.2.0 ) [CRAN]
Installing 5 packages: XML, wdman, binman, subprocess, semver

Error: Failed to install 'RSelenium' from GitHub:
  (converted from warning) unable to access index for repository http://www.omegahat.net/R/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'http://www.omegahat.net/R/bin/macosx/el-capitan/contrib/3.6/PACKAGES'

我该如何解决这个问题? (我的 R 和 RStudio 版本已更新,这通常使软件包对我不起作用。问题修复程序 1 "Restart R Studio" 也没有帮助;))。

您的问题是某些依赖项在您的默认 repo 上不可用。具体来说,这不起作用:

install.packages("binman", repos = "http://www.omegahat.net/R")

RSelenium 当前也可在 CRAN 上使用。因此,您所要做的就是 select 一个包含这些包的 CRAN 镜像。例如:

install.packages(c("XML", "wdman", "binman", "subprocess", "semver", "RSelenium"), 
                 repos = "https://cloud.r-project.org")