break_time_line: Obtain break points along a time line

Description Usage Arguments

Description

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.

Usage

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
)

Arguments

x

a dataframe of all items

time_col

which column in x has the time information

color_col

which column in x has the grouping information

time_order

order of the grouping labels in color_col. If not supplied, it is assumed to follow the order of the mean time of each roup in color_col

abs_min

starting point of the time line. If NULL, it is assumed to be the minimum time in x


Yutong441/TBdev documentation built on Dec. 18, 2021, 8:22 p.m.