Here are the high level steps to write a data function in TERR.
- Write the script
- Create the input parameters
- Create the output parameters
- Run the script
- Map the input and output parameters to the data in the DXP file
- Find outputs and make visible in DXP as needed (for example, if the script created a table output, you will need to add a table visualization to see it).
Things to Know
- The script will be universal. It can be used in any DXP file. The input/output parameters that are created with the script are also universal and can be thought of as shells or containers. When the script is run, data will be put into those containers and run against the TERR functions to generate the desired output specific to the data.
- Case and spacing are important, especially in the input and output parameters.
- Filtering and marking can be utilized in order to limit data.
- Data types defined in the input/output parameters can also be of critical importance.
- Data functions can be setup to run automatically anytime data, filtering or marking changes or you can choose to press a button to rerun the function.
- Make sure that the 'Type' drop down is set to 'R Script - TIBCO Enterprise Runtime for R' and not 'R Script - Open Source R'