Description Usage Arguments Details Author(s) Examples
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.
1 2 |
time |
Vector of times, or character strings that can be coerced into times
using |
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 |
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 |
cex |
Character expansion factor for event strings. If the longest
event string will not fit within half the plot width, then |
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. |
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.
Dan Kelley
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.