I have written two Data Functions in Spotfire as R script Type. One Data Function sources the functions from another Data Function, say "FunctionName.R," in R as:
source("C:\\Users\\Username\\FunctionName.R")
However, I need to reference the same FunctionName.R from the other Data Function in the Spotfire library rather than on the C: drive. It should look something like:
source("\\MainLibrary\\SubLibrary\\FunctionName.R")
where "/MainLibrary/SubLibrary/FunctionName.R" is the Path shown in Data Function Properties. But that path did not work with the source command.
How can I source from the Path shown in Data Function Properties from the same library rather than my local drive?
A quick hack is to first open up the Main Library FunctionName.R file in RStudio, then go to session --> set working directory --> to source file location. Then you'll know the exact file path. Sometimes this is a simple fix.
Essentially, the error you're receiving seems to indicate that either the file you're pointing to does not exist or you are providing
sourcewith an incorrect path. Without knowing your OS, R version, etc, the best way is the easiest way. Have a look here for more information.