timelineVertical: Plot a historical timeline, with time on the vertical axis

Description Usage Arguments Details Author(s) Examples

Description

The time axis appears on the left of the diagram, with lines extending from event times to a list of labels that are right-justified at the right of the diagram. The event label sizes are controlled by the cex argument, but if that value would yield event labels taking more than fraction of the plot area, then the character size is reduced so that the labels take up no more than fraction of the area. Adjusting fraction and plot width may be required to get diagrams that are easily understood.

Usage

1
2
timelineVertical(time, event, col = "black", labelTime = "", file,
  cex = par("cex"), fraction = 0.5, debug = 0)

Arguments

time

Vector of times, or character strings that can be coerced into times using ymd, e.g. "2019-06-30" or "20190630" for May 30, 2019. The times need not be in order, because they (and the event and col values) are all put into temporal order by this function.

event

Vector of (brief) strings indicating what happened at the indicated times. The number of entries must match the number of times.

col

Vector of colours to use for the events. This will be lengthened to match the length of time.

labelTime

String used to label the time axis. The default is to not label the axis, which saves some margin space to the left of the plot.

file

Optional string giving the name of a comma-separated-value file, to be read by read.csv, that possibly contains columns labelled time, event, and col. Any of these columns that are present take precedence over the arguments of those names.

cex

Character expansion factor for event strings. If the longest event string will not fit within half the plot width, then cex will be reduced to make it fit.

fraction

Maximal fraction of plot area to devote to the event labels.

debug

An integer that indicates whethr to printing some information about the processing. This can be handy if problems arise, but the default is to work silently.

Details

If the file argument is given, then the time, event and col arguments need not be given, and indeed the values supplied by those arguments will be ignored.

Author(s)

Dan Kelley

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Method 1: read the data (fifty years of ocean-related research)
entries <- "time, event
1850-01-01,Clausius 2nd law of thermodynamics
1851-01-01,Foucault pendulum
1856-01-01,Ferrel pressure-gradient & wind velocity
1865-01-01,Forchhammer oceanic ion ratio constancy
1867-01-01,Kelvin theorem
1872-01-01,Challenger expediction
1872-01-01,tide prediction machine (Kelvin)
1879-01-01,Stefan black-body radiation law
1879-01-01,Lamb \"Hydrodynamics\"
1881-01-01,Langley radiant heat flux measurement
1883-01-01,Reynolds' turbulence analysis
1883-01-01,Fram expedition
1886-01-01,Vitiaz expedition
1889-01-01,Dutton isostacy
1890-01-01,Pillsbury Gulf Stream surveys
1893-01-01,Fram expedition
1898-01-01,Bjerke method of dynamical analysis
1901-01-01,Bénard convection
1901-01-01,Knudsen seawater tables
1902-01-01,Ekman Spiral
"

d <- read.csv(text=entries, sep=",", header=TRUE)
timelineVertical(d$time, d$event)

# Method 2: specify a file (normally just a filename; here a connection)
timelineVertical(file=textConnection(entries))
mtext("Fifty years of ocean-related science")

dankelley/history documentation built on May 31, 2019, 12:41 a.m.