temporalPlot | R Documentation |
A wrapper for the lattice (trellis) plot methods for grid and station data.
temporalPlot(
...,
aggr.spatial = list(FUN = mean, na.rm = TRUE),
cols = NULL,
lwd = 1,
lty = 1,
missing.dates = TRUE,
show.na = FALSE,
x.axis = c("dates", "index"),
lonLim = NULL,
latLim = NULL,
xyplot.custom = list()
)
... |
Input grids (or station data) |
aggr.spatial |
list containing the function and the related arguments to perform spatial
aggregation. Default is |
cols |
Character with colors. |
lwd |
Numeric for line width. |
lty |
Numeric for line type. |
missing.dates |
Logical. Not implemented (see Details). |
show.na |
Logical. Implemented but under development (see Details). |
x.axis |
Character controlling the x axis. Options are "dates" (default) or "index". The first plots the data according to the date and missing dates are filled with NAs. |
lonLim |
Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected. For single-point queries, a numeric value with the longitude coordinate. If NULL (default), the whole longitudinal range is selected |
latLim |
Same as lonLim, but for the selection of the latitudinal range. |
xyplot.custom |
List of arguments as passed to xyplot. Argument |
The function applies the xyplot
method after computing spatial aggregation
(parameter aggr.spatial
) and member aggregation (mean and range) to the imput grids (or station data).
In case of multimember grids, the function will internally compute the ensemble mean and the range for plotting. The range is used to plot the shadow of the multimember spread.
Controlling graphical parameters
Many different aspects of the plot can be controlled passing the relevant arguments to
xyplot
. Fine control of graphical parameters for the trellis display can
be also controlled using trellis.par.set
.
Future Work
Implement parameters missing.dates (default will be TRUE) to suppress
dates without values from xaxis when FALSE.
Implement parameter show.na (default will be FALSE) to fill with gray
NA values when TRUE.
Implement auxiliary functions to reduce dependencies and remove from
imports packages data.table
, padr
and grDevices
.
A lattice plot of class “trellis”.
M. Iturbide
require(climate4R.datasets)
require(transformeR)
data("CFS_Iberia_tas")
data("EOBS_Iberia_tas")
data("VALUE_Iberia_tas")
# Combine grids with members (CFS) and without members (EOBS)
a <- subsetGrid(CFS_Iberia_tas, years = 1985:1992)
b <- subsetGrid(EOBS_Iberia_tas, years = 1985:1992)
temporalPlot("EOBS" = b, "CFS" = a,
xyplot.custom = list(main = "winter temperature", ylab = "Celsius"))
temporalPlot(list("EOBS" = b, "CFS" = a))
temporalPlot(list("EOBS" = b, "CFS" = a), x.axis = "index" )
# Station and grid data can be combined, also different temporal ranges
v <- subsetGrid(VALUE_Iberia_tas, years = 1988:1990)
temporalPlot("VALUE" = v, "EOBS" = b, "CFS" = a, lwd = 0.9,
aggr.spatial = list(FUN = min, na.rm = TRUE),
xyplot.custom = list(main = "winter temperature",
ylab = "Celsius", ylim = c(-20, 10)))
# Use subsetGrid to obtain and plot a single location (no spatial aggregation)
a1 <- subsetGrid(a, lonLim = 2, latLim = 42)
b1 <- subsetGrid(b, lonLim = 2, latLim = 42)
temporalPlot("EOBS" = b1, "CFS" = a1,
cols = c("green", "deeppink"), show.na = TRUE,
xyplot.custom = list(main = "winter temperature", ylab = "Celsius"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.