【问题标题】:Cannot install RStudio addins on my Windows laptop from behind proxy无法从代理后面在我的 Windows 笔记本电脑上安装 RStudio 插件
【发布时间】:2018-03-20 12:58:35
【问题描述】:

我的会话信息(基本上是 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,但没有成功。无论我尝试安装什么插件,使用devtools::install_github(请参阅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 插件?

【问题讨论】:

    标签: r proxy rstudio devtools


    【解决方案1】:

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

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

    【讨论】:

    • 您应该将port_number 更正为port = port_number。这将使答案更具可读性,我会接受它。
    • 感谢您的建议。
    猜你喜欢
    • 2023-03-19
    • 1970-01-01
    • 2018-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多