Description Usage Arguments Details Value Note See Also Examples
View source: R/makeMonthlyStat.R
We frequently want to summarize CMIP5 data by month, e.g. to understand how air temperature varies over the year for a particular data range. This function does that for monthly data. The default statistic is mean, but any summary function that returns a numeric result can be used.
1 | makeMonthlyStat(x, verbose = FALSE, sortData = FALSE, FUN = mean, ...)
|
x |
A |
verbose |
logical. Print info as we go? |
sortData |
logical. Sort |
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 monthly
mean of the variable. A numYears
field is also added
recording the number of years averaged for each month.
If x
is not in a needed order (for example, FUN
uses
weights in a different order), be sure to specify sortData=TRUE
.
makeAnnualStat
makeZStat
makeGlobalStat
1 2 3 4 | d <- cmip5data(1970:1975) # sample data
makeMonthlyStat(d)
summary(makeMonthlyStat(d))
summary(makeMonthlyStat(d, FUN=sd))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.