R(Period: IMsPeriod,
Code: String,
Inputs: Array)
Period. Period, at which the method is calculated. If the parameter value is Null, the method is calculated at the entire time period.
Code. Expression for method calculation.
Inputs. Array of input variables.
It transforms data using R package methods.
Integration with R must be set up in the repository to use this method. For details about integration setup see the How to Set Up Integration with R? section.
Features of working with the Code parameter:
Expression is set in the R language. For more detailed description of R language see R documentation
Input variables in an expression are indicated as X1, X2 and so on, where 1, 2 is the index of the variable in the Inputs array. Indexing in the array is continuous and starts with zero.
Formula | Result | Application |
= R(Setperiod("01.01.2000", "01.01.2015"), "Y <- X1 + 1;", {Chicago - population[t]}) | Values of the Chicago - population[t] time series are increased by one using the R package. |
It can be used in formulas of calculated series of time series database and in formulas of attribute-based models. |
= R(SetPeriod("01.01.2000", "01.01.2015"), "Y <- X1 + 1;", X1, X2) | Value of the X1 variable is increased by one using the R package methods. |
It can be used in model formulas of modeling container. |
See also:
Functions Available in Expression Editor | R Methods | IModelling.R