| plot_mdate | R Documentation |
plot() draws one line for each messy date, so that its imprecision can
be seen before it is resolved.
The height of each shape is the weight of each possible day:
A precise date is a point.
A range, or a value with year or month precision, is a bar of full height, because each of its days has the same weight.
A set, or a value with unspecified digits (X), shows each of its
possible dates as a point, joined by a dotted line.
An approximate value (~ or %), with approx_range more than 0,
is a trapezoid: a full-height core across the dates that the value
names, and sides that fall to 0 over the dates that approx_range
adds. These are the weights that vrandom() uses.
An uncertain value (? or %) has a dashed outline and no fill,
because the source doubts the record, but its dates do not change.
Missing values and the empty set, {}, are not drawn.
A time of day is not drawn; each value is drawn by its days.
## S3 method for class 'mdate'
plot(x, labels = NULL, approx_range = 0, sort = TRUE, main = NULL, ...)
x |
An |
labels |
A character vector of labels, one for each element of |
approx_range |
The number of units that an approximate value widens
by on each side, as in |
sort |
Should the lines be sorted by the earliest possible date?
|
main |
A title for the plot. |
... |
Other arguments passed to |
A data frame, invisibly, with the value, label, earliest day and latest day of each element that was drawn, in the order drawn from the top.
plot(battles$Date, labels = battles$Battle)
plot(as_messydate(c("2012-03-15", "2012-04", "2012-05-10..2012-06-20",
"2012-07-~15", "2012-~09", "2012-10?",
"{2012-02-01,2012-11-15}", "2012-XX-28")),
approx_range = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.