Description Usage Arguments Details Value Note See Also Examples
View source: R/makeAnnualStat.R
Most CMIP5 data are monthly, and we frequently want to summarize these to annual numbers. This function does that (although annual files also occur, and will be handled as well). The default statistic is mean, but any summary function that returns a numeric result can be used.
1 2 |
x |
A |
verbose |
logical. Print info as we go? |
sortData |
logical. Sort |
filterNum |
logical. Only keep the years which share the most common count. For example, only keep years with 12 months and discard those with 11 or fewer. |
FUN |
function. Function to apply across months of year |
... |
Other arguments passed on to |
The stat function is calculated for all combinations of lon, lat, and Z (if present).
A cmip5data
object, whose val
field is the annual
mean of the variable. A numMonths
field is also added
recording the number of months averaged for each year.
If x
is not in a needed order (for example, FUN
uses
weights in a different order), be sure to specify sortData=TRUE
.
makeZStat
makeGlobalStat
makeMonthlyStat
1 2 3 4 | d <- cmip5data(1970:1975) # sample data
makeAnnualStat(d)
summary(makeAnnualStat(d))
summary(makeAnnualStat(d, FUN=sd))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.