How to source R file in palantir foundry code-workbook

158 Views Asked by At

I would like to build a pipeline in code-workbook using many different functions I stored into an R-script (functions.R).

I would like to use functions from this script in some of the steps of my pipeline and I'm wondering whether it's possible to source functions.R.

In R I would do it like that: source('path/functions.R')

Is there a way to bring functions.R into Foundry and source the file from any step in a code-workbook pipeline?

I don't know where to store and how to source my functions.R file.

1

There are 1 best solutions below

0
joel sasieni On

You could copy-paste the whole code contained in the functions.R file into the "Global code" section ("" icon on the upper right corner, next to the console icon). In this way all functions defined there would be available in every node of the workbook.

AFAIK there isn't a simple way to upload the R file itself into foundry's logical filesystem and source it from there. Even if it's possible, there wouldn't be an app easily able to edit it.