当我在RStudio中直接调用以下内容时,它可以正常工作。
readLines("https://raw.githubusercontent.com/renkun-ken/rlist-tutorial/master/data/sample.yaml")
但是,当我从rterm
拨打电话或将代码保存到.R文件(例如readlines.R
)并致电
system("rscript readlines.R")
然后发生错误:
Error in file(con, "r") : cannot open the connection
Calls: readLines -> file
In addition: Warning message:
In file(con, "r") : unsupported URL scheme
Execution halted
Warning message:
running command 'rscript readlines.R' had status 1
我尝试了一个HTTP网址,没有问题,但是如果代码是从外部调用的话,我使用的HTTPS URL总是会出现此错误。
我该如何解决这个问题?
我的会话信息:
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.1