To add information to the swimmer plot we can use the swimmer points
function.
We will here use the swimmer_plot
function in the Data & Functions page and the
swimmer_points()
function.
swimmer_points(
df_points,
a data
frame
id = "id",
column name for id
time = "time",
column name with the point
locations
adj.y = 0,
amount to adjust the
point within the box vertically (default is 0, point is in the centre of
each bar)
name_shape = NULL,
a column name to map the
point shape
name_col = NULL,
a column
name to map the point colour
name_size = NULL,
a column name to map the point
size
name_fill = NULL,
a column name to map
the point fill
name_stroke = NULL,
a
column name to map the
name_alpha = NULL,
a column name to map the point
transparency
...
)
This document is a work of the statistics team in the Biostatistics and Medical Information Department at Saint-Louis Hospital in Paris (SBIM).
Based on The R Graph Gallery by Yan Holtz.