This article shares tips and tricks from the Spotfire User Group for creating custom functions using TERR (TIBCO Enterprise Runtime for R) and R.
Create you own functions using TERR & R
Data functions that call the TIBCO Enterprise Runtime for R engine can now be configured to aggregate data. In the image below, a new expression function has been created using the new Function type "Aggregation function":
In the example above the function FahrenheitToCelcius is defined using the code below:
#Define the FahrenheitToCelcius function
FahrenheitToCelcius <- function(TempCelcius)
{
TempFahrenheit <- TempCelcius *(9/5) + 32
TempFahrenheit
}
#Run the function to produce the output
output <- FahrenheitToCelcius(TempCelcius = input1)
Once defined, the function can be used to add a "normal" calculated column.
Recommended Comments
There are no comments to display.