tsbars {divDyn} | R Documentation |
Function to plot a series a values with bars that have variable widths
Description
Function to use bars for time series.
Usage
tsbars(x, y, width = "max", yref = 0, gap = 0, vertical = TRUE, ...)
Arguments
x |
|
y |
|
width |
|
yref |
|
gap |
|
vertical |
|
... |
Arguments passed to |
Details
People often present time series with connected points, although the visual depiction implies a certain process that describes how the values change between the points.
Instead of using simple scatter plots, Barplots can be used to describe series where a single value is the most descriptive of a discreet time bin. The tsbars()
function
draws rectangles of different widths with the rect
function, to plot series in such a way.
Value
The function has no return value.
Examples
# an occurrence-based example
# needed data
data(stages)
data(corals)
# calculate diversites
dd <-divDyn(corals, tax="genus", bin="stg")
# plot range-through diversities
tsplot(stages, xlim=51:94, ylim=c(0,250), boxes="sys")
tsbars(x=stages$mid, y=dd$divRT, width=stages$dur, gap=1, col=stages$col)