PeriodMean {CSIndicators} | R Documentation |
Period Mean computes the average (mean) of a given variable in a period. Providing temperature data, two agriculture indices can be obtained by using this function:
GST
Growing Season average Temperature: The average
temperature from April 1st to Octobe 31st
SprTX
Spring Average Maximum Temperature: The average daily
maximum temperature from April 1st to May 31st
PeriodMean(
data,
dates = NULL,
start = NULL,
end = NULL,
time_dim = "time",
na.rm = FALSE,
ncores = NULL
)
data |
A multidimensional array with named dimensions. |
dates |
A vector of dates or a multidimensional array of dates with named dimensions matching the dimensions on parameter 'data'. By default it is NULL, to select a period this parameter must be provided. |
start |
An optional parameter to defined the initial date of the period
to select from the data by providing a list of two elements: the initial
date of the period and the initial month of the period. By default it is set
to NULL and the indicator is computed using all the data provided in
|
end |
An optional parameter to defined the final date of the period to
select from the data by providing a list of two elements: the final day of
the period and the final month of the period. By default it is set to NULL
and the indicator is computed using all the data provided in |
time_dim |
A character string indicating the name of the dimension to
compute the indicator. By default, it is set to 'ftime'. More than one
dimension name matching the dimensions provided in the object
|
na.rm |
A logical value indicating whether to ignore NA values (TRUE) or not (FALSE). |
ncores |
An integer indicating the number of cores to use in parallel computation. |
A multidimensional array with named dimensions containing the
indicator in the element data
.
exp <- array(rnorm(56), dim = c(member = 7, ftime = 8))
SA <- PeriodMean(exp, time_dim = 'ftime')