R Library in Plugin

Solved!
jvijayakumar2
Level 3
R Library in Plugin

I'm creating a custom R recipe in a plugin and I want to include a library folder. Is there a way to do this like how we have a python-lib folder with all .py files and use from-import to have the method imported in the recipe.py file?

0 Kudos
1 Solution
AlexT
Dataiker

Hi @jvijayakumar2 ,


The solution for the R code recipe plugin is to create a resources folder and use dkuCustomRecipeResource 
https://doc.dataiku.com/dss/api/11/R/dataiku/reference/dkuCustomRecipeResource.html

e.g source(file.path(dkuCustomRecipeResource(), "clean.R"))

You can find an example plugin doing this here for reference:

https://github.com/dataiku/dss-plugin-timeseries-forecast-legacy

Thanks

View solution in original post

0 Kudos
1 Reply
AlexT
Dataiker

Hi @jvijayakumar2 ,


The solution for the R code recipe plugin is to create a resources folder and use dkuCustomRecipeResource 
https://doc.dataiku.com/dss/api/11/R/dataiku/reference/dkuCustomRecipeResource.html

e.g source(file.path(dkuCustomRecipeResource(), "clean.R"))

You can find an example plugin doing this here for reference:

https://github.com/dataiku/dss-plugin-timeseries-forecast-legacy

Thanks

0 Kudos

Labels

?
Labels (3)
A banner prompting to get Dataiku