Description Usage Arguments Examples
This function will create a timeline using the
ggplot2 framework in a style similar to
Preceden. There are two
types of events, those that have a range (i.e. a start
and end date) and and points-in-time. The latter can be
grouped in separate rows to prevent overlapping or to
organize different types of events. Grouping of
point-in-time events will color code those events
accordingly.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |   timeline(df, events, label.col = names(df)[1],
    group.col = names(df)[2], start.col = names(df)[3],
    end.col = names(df)[4],
    text.position = c("left", "right", "center"),
    text.size = 4, text.color = "black", text.alpha = 1,
    text.angle = 0, text.family = "serif",
    text.fontface = 1, text.hjust, text.vjust = 0.5,
    text.lineheight = 1, num.label.steps = 5,
    event.label.col, event.col, event.group.col,
    event.spots = 1, event.label = "",
    event.label.method = 1, event.line = FALSE,
    event.text.size = 4, event.text.color = "black",
    event.text.alpha = 1, event.text.angle = 0,
    event.text.family = "serif", event.text.fontface = 1,
    event.text.vjust = 0.5, event.text.lineheight = 1,
    event.above = TRUE, border.color = "white",
    border.linetype = 1, limits, ...)
 | 
| df | data for time periods. | 
| events | data for events (optional). | 
| label.col | the column name in  | 
| group.col | the column name in  | 
| start.col | the column name in  | 
| end.col | the column name in  | 
| text.size | the text size for labels in  | 
| text.color | the text color for labels in
 | 
| text.position | the positioning of the text (i.e. left, right, or center). | 
| text.alpha | the alpha level for labels. | 
| text.angle | the angle for labels. | 
| text.family | the font family for labels. | 
| text.fontface | the font face for labels. | 
| text.hjust | the horizontal adjustement for labels.
The default will be set based upon the value of
 | 
| text.vjust | the vertical adjustement for labels. | 
| text.lineheight | the lineheight for labels. | 
| num.label.steps | the number of steps to use for labeling events. | 
| event.label.col | the column name in  | 
| event.col | the column name in  | 
| event.group.col | the column name in  | 
| event.spots | the number of rows to use for events.
Note that each group in  | 
| event.label | the label to use on the x-axis for events. | 
| event.label.method | the labeling method. For
 | 
| event.line | whether to draw a vertical line for each event. | 
| event.text.color | the text color of event labels. | 
| event.text.size | the text size for event event labels. | 
| event.text.alpha | the alpha level for event labels. | 
| event.text.angle | the angle for event labels. | 
| event.text.family | the font family for event labels. | 
| event.text.fontface | the font face for event labels. | 
| event.text.vjust | the vertical adjustement for event labels. | 
| event.text.lineheight | the lineheight for event labels. | 
| event.above | whether events should be plotted above
( | 
| border.color | the color of the border around each box. | 
| border.linetype | the linetype of the border around each box. | 
| limits | the limits of the y-axis. | 
| ... | currently unused. | 
| 1 2 3 | data(ww2)
timeline(ww2, ww2.events)
timeline(ww2, ww2.events, event.spots=2, event.label='', event.above=FALSE)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.