RStudio 设置HTTP代理
RStudio 配置信息
RStudio 2023.06.1+524 “Mountain Hydrangea” Release (547dcf861cac0253a8abb52c135e44e02ba407a1, 2023-07-07) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.06.1+524 Chrome/110.0.5481.208 Electron/23.3.0 Safari/537.36
通过配置文件添加 HTTP 服务器
在 C:\Users\XXX\Documents\.Renviron>
文件里增加如下设置
http_proxy = proxy.example.com:8080
https_proxy = proxy.example.com:8080
http_proxy_user = your_proxy_username
http_proxy_password = your_proxy_password
# 后两句可以换成
http_proxy_user = ask
更详细的参考这里:Configuring R to Use an HTTP or HTTPS Proxy
这把应该能用了吧,结果遇到如下错误:
...
schannel: failed to receive handshake, SSL/TLS connection failed
安装 openssl
包
百度里没找到准确的解决办法,但 GitHubDesktop 也报相同错误,其解决办法如下
因此,不管三七二十一先安装 openssl
包再说
install.packages("openssl")
再尝试,就这么解决了
library(quantmod)
getSymbols('SPY')
chartSeries(SPY)