Sourcing R script over HTTPS

前端 未结 6 1645
盖世英雄少女心
盖世英雄少女心 2020-11-30 05:52

Is there some way to source an R script from the web?

e.g. source(\'http://github.com/project/R/file.r\')

Reason: I currently have a project tha

6条回答
  •  失恋的感觉
    2020-11-30 06:32

    The methods here were giving me the following error from github:

    OpenSSL: error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
    

    I used the following function to resolve it:

    github.download = function(url) {
      fname <- tempfile()
      system(sprintf("curl -3 %s > %s", url, fname))                                                                                                                                                                                                                                                                                                                          
      return(fname)
    }
    source(github.download('http://github.com/project/R/file.r'))
    

    Hope that helps!

提交回复
热议问题