"phenoAmp"(x, season.range = c(1, 12))
zoo
object.
ts
or zoo
with individual series for the range, variance, median absolute deviation, mean, median and -- in the case of zoo
objects -- number of samples.
phenoAmp
gives three measures of the amplitude of a seasonal cycle: the range, the variance, and the median absolute deviation, along with the mean and median to allow calculation of other statistics as well.These measures can be restricted to a subset of the year by giving the desired range of season numbers. This can be useful for isolating measures of, say, the spring and autumn phytoplankton blooms in temperate waters. In the case of a monthly time series, for example, a non-missing value is required for every month or the result will be NA
, so using a period shorter than one year can also help avoid any months that are typically not covered by the sampling program. Similarly, in the case of dated observations, a shorter period can help avoid times of sparse data. The method for time series allows for other than monthly frequencies, but season.range
is always interpreted as months for zoo
objects.
Note that the amplitude is sensitive to the number of samples for small numbers. This could be a problem for zoo
objects if the sample number is changing greatly from year to year, depending on the amplitude measure and the underlying data distribution. So use ts
objects or make sure that the sample number stays more or less the same over time.
tsMake
can be used to produce ts
and zoo
objects suitable as arguments to this function.
phenoPhase
, tsMake
y <- sfbayChla[, 's27']
phenoAmp(y) # entire year
phenoAmp(y, c(1, 6)) # i.e., Jan-Jun only, which yields results for more years
Run the code above in your browser using DataLab