rdeployr

R: DeployR access functions from another file


I am executing a R script within DeployR but currently all my function definitions etc. lie inside this same file which then becomes huge.

Is there a way to split the definitions into another file? Right now if I paste them into another file and save that file in the same dir in the Online DeployR Repository the original file cannot seem to see them.

Any workarounds?


Solution

  • The easiest way is to put the function file inside the deployr external folder and source it from there. See https://deployr.revolutionanalytics.com/documents/dev/scientist-portable-code/#fileaccessport for an example (the example is reading a csv file but the idea is the same)