satinMean | R Documentation |
This function allows to average ocean data by a selected time period. For example, from daily data, the user may want to obtain weekly, monthly, quarterly or even yearly averages.
satinMean(X, by = "%m", depth = NULL)
X |
a satin object as returned by |
by |
a character string specifying the averaging time period, see details. |
depth |
an integer referring to a given depth level (defaults to 1). Only meaningful for Copernicus data that includes variables at different depths. |
Accepted strings in by
follow the notation of conversion specifications described in strptime
. Currently implemented: "%Y"
, "%m"
, "%Y-%m"
, "%j"
, "%qtr"
, "%Y-%qtr"
, "%sem"
, "%Y-%sem"
, "%U"
, "%V"
, "%W"
, "%Y-%U"
, "%Y-%V"
, "%Y-%W"
. This includes two non-standard strings and their combinations with year: "%qtr"
, and "%sem"
, for quarter and semester, respectively, which are passed to lubridate's functions of the same names. This function is meant to be used in combination with anomaly
to obtain anomalies with respect to an average period.
An object of class "satin"
(see satin-class
for details) where the third dimension in the data array accomodates averages by time period. An extra element (labels
) is included in the slot attribs
to identify the time period used for the averages.
Héctor Villalobos and Eduardo González-Rodríguez
anomaly
for calculating anomalies of ocean data, and climatology
for climatologies.
if(interactive()){ sst.ym <- satinMean(sst, by = "%Y-%m") # sst is a satin object with 240 weekly # images, totalling five years of data. sst.ym # this will have 60 time periods, one for every month and year. sst.m <- satinMean(sst, by = "%m") # this will produce 12 monthly periods }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.