从URL加载R文件

时间:2016-04-19 10:35:34

标签: r file url load

有没有办法从URL加载(不运行)R脚本? .tooltip.textright { padding: 0 5px; margin-left: 3px; } .tooltip.textleft { padding: 0 5px; margin-left: -3px; } .tooltip.textleft .tooltip-arrow{ top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000; } .tooltip.textright .tooltip-arrow{ top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000; } 似乎只适用于本地文件。例如,以下测试文件:https://a.uguu.se/wzhzrg_test.R

2 个答案:

答案 0 :(得分:2)

rs_url_open <- function(URL) {
  tf <- tempfile(fileext=".R")
  download.file(URL, tf, quiet=TRUE)
  rstudioapi::navigateToFile(tf)
}

rs_url_open("https://a.uguu.se/wzhzrg_test.R")

答案 1 :(得分:0)

url.show("https://a.uguu.se/wzhzrg_test.R")

这会显示代码,但您不会提供代码。