Building binary package R

前端 未结 2 1143
故里飘歌
故里飘歌 2021-01-29 03:56

I am new to R and I am trying to make a standalone executable so that my scripts can be run without development tools. I have created multiple R scripts containing different fun

2条回答
  •  别那么骄傲
    2021-01-29 04:32

    After help from @r2evans I have managed to find a solution to the problem.

    My main.r file was just a bunch of function calls with no function wrapping them. So I wrapped the function calls in a function and the function now looks as follows:

    mainFunction <- function() {
    
        source("R/initSetup.r")
        initSetup()
    
        ... 
    }
    

    initSetup.r contains more source() calls to the other files that I use. The program is then run using the command mainFunction() in the R console

提交回复
热议问题