seas (version 0.4-3)

seas.var.plot: Plot seasonal normals of a given variable

Description

Plot seasonal normals of a variable using boxplots.

Usage

seas.var.plot(x, var, width = 11, start = 1, rep = 0, start.day = 1,
              col, ylim, add.alt, alt.ylab, main, ylab, ylog, …)

Arguments

x

a data.frame with Date and var columns of data; x can also have id or name attributes to help give a title for the plot

var

a variable; a column name in x; this can also have attributes of units and long.name to help give a title for the y-axis

width

size of bin; see mkseas

start

starting bin number; e.g., if width="mon" and start=5, the plot will start on "May" at the left-hand side

rep

repetition of the bins in the boxplot

start.day

when width is numeric, this is the starting day of the year for the fist bin, or it can be a Date to specify a month and day (year is ignored)

col

colour for the boxplots; the default is "lightgrey"

ylim

c(min, max) range for y-axis

add.alt

this adds an alternative axis, and is specified by c(slope,inter); for example, if the primary measure is in <U+00B0>C, a secondary scale in K would be c(1,273.15), or in <U+00B0>F would be c(5/9,32); if ylog=TRUE, then this can also be TRUE to display the \(\log_{10}\) transformed values of var on the alternative axis

alt.ylab

label for the alternate y-axis (the primary y-axis label is set through attributes for var in x)

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 \(\log_{10}\) transform values of var for the boxplots; this has a similar but different affect than specifying par(ylog=TRUE) before this function

ignored

Value

Returns values from boxplot statistics on the variable.

Details

Shows normals of a seasonal variable using boxplots.

See Also

seas.var.plot, plot.seas.norm, year.plot.

Use mksub to make a subset of x.

Examples

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataLab