seas.var.plot | R Documentation |
Plot seasonal normals of a variable using boxplots.
seas.var.plot(x, var, width = 11, start = 1, rep = 0, start.day = 1, col, ylim, add.alt, alt.ylab, main, ylab, ylog, ...)
x |
a |
var |
a variable; a column name in |
width |
size of bin; see |
start |
starting bin number; e.g., if |
rep |
repetition of the bins in the boxplot |
start.day |
when |
col |
colour for the boxplots; the default is |
ylim |
|
add.alt |
this adds an alternative axis, and is specified by
|
alt.ylab |
label for the alternate y-axis (the primary y-axis
label is set through attributes for |
main |
title for plot; if it is missing, then it will automatically be generated |
ylab |
y-axis label; if it is missing, then it will automatically be generated |
ylog |
used to log10 transform values of
|
... |
ignored |
Shows normals of a seasonal variable using boxplots.
Returns values from boxplot
statistics on the variable.
This function was formerly named plot.seas.var
, but required
renaming as it is not an S3 method.
Mike Toews
seas.var.plot
, plot.seas.norm
,
year.plot
.
Use mksub
to make a subset of x
.
opar <- par(no.readonly=FALSE) on.exit(par(opar)) data(mscdata) dat <- mksub(mscdata, id=1108447) seas.var.plot(dat, var="t_max", col="tomato", add.alt=c(5/9, 32), alt.ylab="F") abline(h=0) par(opar) # reset graphics parameters seas.var.plot(dat, var="t_min", start=18, rep=16) pdat <- dat[dat$precip > 0,] attr(pdat$precip, "long.name") <- "precipitation intensity" attr(pdat$precip, "units") <- "mm/day" par(ylog=TRUE) seas.var.plot(pdat, var="precip", col="azure") title(sub="These boxplots are simply plotted on a log-y scale") par(opar) seas.var.plot(pdat, var="precip", col="azure", ylog=TRUE) title(sub="These boxplots are based on log-transformed values") seas.var.plot(pdat, var="precip", col="azure", ylog=TRUE, add.alt=TRUE) title(sub="The actual axis for graph is on the right-side")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.