Custom R Script
Last updated
Last updated
You might want to use your own R functions as part of your data wrangling steps. This is an introduction for such case. If you want to write your own R functions to extract data, please refer to Write R Script for Data.
You can write your functions in an R script and register it to your project, then you can start calling the functions just like any other functions.
This is an example to use alpha function from psych R package from Exploratory Desktop.
In this example, psych is already installed as a default dependency package but the function you want to use might be from a package that we don't install as default. In that case, please install the package following this instruction.
Create a new R script from the left tree.
Define a function. Please note that the first argument is data frame and the output is also data frame, so that it can be used from command line.
Then, click "Save" button.
You can use the function from a data frame you want to apply. Click 'Add' (Plus) button and click "Custom Command".
Then you can enter the function in the command line.
Here is a blog post that walk you through how to register the R script and use the functions.