Description Usage Arguments Value Author(s) See Also Examples
Computes the spatial average of a field object and return a zoo time series object.
1 |
x |
A zoo field object with two (longitude, latitude) or three dimensions (longitude, latitude, time) |
A "zoo" "time series" object
A. Mezghani, MET Norway
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Consider the "gcm" object from the e.g. in \link{retrieve.ncdf4}
# Compute the spatial average along lon and lat in gcm2
gcm2 <- spatial.avg.field(gcm)
# keep all attributes in gcm2
gcm2 <- attrcp(gcm,gcm2)
# Compute the annual mean
gcm.am <- as.annual(gcm2,FUN=mean,na.rm=TRUE)
# keep all attributes in gcm.am
gcm.am <- attrcp(gcm2,gcm.am)
year <- index(gcm.am)
# Compute the anomalies relative to the period 1986-2005
agcm.ave <- gcm.am-mean(gcm.am[is.element(as.numeric(year),c(1986:2005))])
agcm.ave <- attrcp(gcm.am,agcm.ave)
# plot anomaly time series of the global mean temperature
frame.metno(agcm.ave,col="black",cex.lab=0.75,cex.axis=0.75) ! Should be
updated !
# Add vertical margin text with y-label
mtext("Anomaly values relative to 1986-2005",side=2,line=2,cex=0.75,las=3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.