When I directly call the following in RStudio, it works fine.
readLines("https://raw.githubusercontent.com/renkun-ken/rlist-tutorial/master/data/sample.yaml")
However, when I call from rterm
or save the code to a .R file (say, readlines.R
) and call
system("rscript readlines.R")
Then an error occurs:
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
I tried a HTTP URL and there's no problem but HTTPS URL like I used always ends up in this error if the code is called from external.
How can I fix this?
My session info:
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