violinPlot | R Documentation |
A wrapper for the lattice (trellis) plot methods for grid and station data.
violinPlot(
...,
group.index = NULL,
violin = TRUE,
fill = TRUE,
color.fun = list(FUN = mean, na.rm = TRUE),
color.theme = "RdYlBu",
color.cuts = NULL,
rev.colors = FALSE,
box.col = NULL,
h.lines = NULL,
v.lines = FALSE,
lonLim = NULL,
latLim = NULL,
bwplot.custom = list()
)
... |
Input grids (or station data). It can be a list of grids too. |
group.index |
Character or numeric passed to argument group in bwplot. |
violin |
(default is TRUE). If FALSE, boxplots are returned. |
fill |
Logical indicating if the violins/boxes are filled with color. if TRUE, arguments
|
color.fun |
list containing the function and the related arguments to perform spatial
aggregation. The resulting values are used to fill with color the violins.
Default is |
color.theme |
A character string indicating the color theme to use in the map.
Valid values are those available in the |
color.cuts |
Numeric sequence indicating the color cuts. |
rev.colors |
Default to FALSE. If TRUE the reversed version of the color palette is used. |
box.col |
Character or numeric of the color to be given to the box borders. |
h.lines |
Numeric sequence indicating the position of dashed horizontal lines. |
v.lines |
Logical for drawing vertical lines (Default is FALSE). |
lonLim |
Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected. If NULL (default), the whole longitudinal range is selected |
latLim |
Same as lonLim, but for the selection of the latitudinal range. |
bwplot.custom |
List of arguments as passed to Controlling graphical parameters Many different aspects of the plot can be controlled passing the relevant arguments to
|
A lattice plot of class “trellis”.
M. Iturbide
require(climate4R.datasets)
data("EOBS_Iberia_tas")
data("EOBS_Iberia_pr")
data("CORDEX_Iberia_pr")
violinPlot("one" = climatology(EOBS_Iberia_pr),
"two" = climatology(EOBS_Iberia_tas),
"three" = climatology(CORDEX_Iberia_pr),
h.lines = seq(0, 15, 5),
color.cuts = seq(0, 3, 0.2),
bwplot.custom = list(ylim = c(0, 20),
ylab = "pr and tas"))
## With grouping:
data("EOBS_Iberia_tas")
data("EOBS_Iberia_pr")
data("CORDEX_Iberia_pr")
data("CORDEX_Iberia_tas")
violinPlot("pr" = climatology(EOBS_Iberia_pr),
"tas" = climatology(EOBS_Iberia_tas),
"pr" = climatology(CORDEX_Iberia_pr),
"tas" = climatology(CORDEX_Iberia_tas),
group.index = c("Measure1", "Measure1", "Measure2", "Measure2"),
h.lines = seq(0, 15, 5),
v.lines = TRUE,
color.cuts = seq(0, 3, 0.2),
bwplot.custom = list(ylim = c(0, 20),
ylab = "pr and tas",
as.table = TRUE))
## Boxplot:
data("EOBS_Iberia_tas")
data("EOBS_Iberia_pr")
data("CORDEX_Iberia_pr")
data("CORDEX_Iberia_tas")
a <- violinPlot("pr" = climatology(EOBS_Iberia_pr),
"tas" = climatology(EOBS_Iberia_tas),
violin = FALSE,
fill = FALSE,
h.lines = seq(0, 15, 5),
v.lines = TRUE,
box.col = "blue",
bwplot.custom = list(ylim = c(0, 20),
ylab = "pr and tas",
as.table = TRUE,
do.out = FALSE))
b <- violinPlot("pr" = climatology(CORDEX_Iberia_pr),
"tas" = climatology(CORDEX_Iberia_tas),
violin = FALSE,
fill = FALSE,
h.lines = seq(0, 15, 5),
v.lines = TRUE,
box.col = "green",
bwplot.custom = list(ylim = c(0, 20),
ylab = "pr and tas",
as.table = TRUE,
do.out = FALSE))
a + b
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.