This function finds the interval of different periods along a time line. This is not trivial, because sometimes different periods overlap with each other. For aesthetic reasons however, there is significant demand to show the periods as being mutually exclusive (which I strongly dislike). As a result, this function will first find the min and max of time periods in each group. The min is taken as the starting point. If the ending point is the min of the next time period. If the min of the next time period precedes that of its previous one, the starting point of the next time period is taken to be the max of the previous time period.
1 2 3 4 5 6 7 8 | break_time_line(
x,
time_col,
color_col,
time_order = NULL,
abs_min = NULL,
abs_max = NULL
)
|
x |
a dataframe of all items |
time_col |
which column in |
color_col |
which column in |
time_order |
order of the grouping labels in |
abs_min |
starting point of the time line. If NULL, it is assumed to be
the minimum time in |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.