无法通过代理在我的 Windows 笔记本电脑上安装 RStudio 插件

Cannot install RStudio addins on my Windows laptop from behind proxy

我的会话信息(基本上是 Microsoft R Open 3.4.1,RStudio 1.0.153,Windows 10 64 位)

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

other attached packages:
[1] RevoUtilsMath_10.0.1

loaded via a namespace (and not attached):
 [1] httr_1.3.1       compiler_3.4.1  
 [3] R6_2.2.0         RevoUtils_10.0.6
 [5] tools_3.4.1      withr_2.0.0     
 [7] curl_2.6         memoise_1.1.0   
 [9] git2r_0.19.0     digest_0.6.12   
[11] devtools_1.13.3 

我正在尝试安装一些 RStudio addins without success. Whatever addin I try to install, the recommended procedure of using devtools::install_github (see Installation) 失败并显示相同的错误消息:

> devtools::install_github("benmarwick/wordcountaddin", type = "source", dependencies = TRUE)
Installation failed: Failure when receiving data from the peer
> devtools::install_github("rstudio/addinexamples", type = "source")
Installation failed: Failure when receiving data from the peer

我在公司代理后面工作。我可以毫无问题地从 CRAN 安装 R 包:

> install.packages("devtools")
Installing package into ....
(as ‘lib’ is unspecified)
trying URL 'https://mran.microsoft.com/snapshot/2017-09-01/bin/windows/contrib/3.4/devtools_1.13.3.zip'
Content type 'application/zip' length 443758 bytes (433 KB)
downloaded 433 KB

package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
....

如何安装 RStudio 插件?

您可以使用 httr 包的代理设置从 github 安装:

library(httr)
with_config(use_proxy(url='proxy url', port = port_number, 
                      username="username", password="yourpass"), 
            devtools::install_github('github/directory'))