Sourcing an R script from github, for global session use, from within a wrapper function?

前端 未结 1 1291
暗喜
暗喜 2021-01-31 19:35

I can source an R script held on github (using the \'raw\' text link) as follows:

# load package
require(RCurl)

# check 1
ls()
#character(0)

# read script line         


        
1条回答
  •  梦毁少年i
    2021-01-31 20:20

    Use:

     eval(parse(text = script),envir=.GlobalEnv)
    

    to stick the results into your default search space. Overwriting anything else with the same names, of course.

    0 讨论(0)
提交回复
热议问题