Swimmer Plot
Data & Functions


Data


We use the following datasets: Download datasets

Data should be in the long format (each row is one time point per subject).

base_swimmer_trt base_swimmer_relapsedeath base_swimmer_eventsupp base_swimmer_eval
ID Patient ID ID Patient ID ID Patient ID ID Patient ID
TYPCURE Type of cure event Type of event event Type of event LAMREP Type of response
time Time from diagnosis time Time from diagnosis time Time from diagnosis time Time from diagnosis

ID TYPCURE time
3 no treatment 0.0985626
3 induction 1.0184805
3 no treatment 1.8726899
3 consolidation 2.9568789

ID event time
6 Death 12.911704
10 Relapse 7.359343
10 Relapse 9.889117
10 Death 10.809035

ID time event
6 12.411704 Other event to represent
10 6.859343 Other event to represent
10 9.389117 Other event to represent
10 10.309035 Other event to represent

ID LAMREP time
3 CR 1.839836
3 CR 3.154004
4 CR 0.788501
4 CR 1.412731



swimmer_plot function


swimmer_plot(
df, a data frame
id = "id", column name for id
end = "end", column name with the bar lengths (or bar end positions if bars change colour)
start = "start", column name with the bar start positions (only required when there are gaps between sections of bars, or bars which do not start at zero)
col, color of the border of the bars
name_fill = NULL, a column name to map the bar fill
name_col = NULL, a column name to map the bar colour
name_alpha = NULL, a column name to map the bar transparency
increasing = TRUE, increasing order (Default is TRUE)
id_order = NULL, order of the bars by id, can input a column name to sort by, or the ids in order
stratify = FALSE, a list of column names to stratify by
base_size = 11, the base size for the plot, default is 11
identifiers = TRUE, binary to specify patient identifiers are included in the y axis (default is TRUE)
...
)




Contact

This document is a work of the statistics team in the Biostatistics and Medical Information Department at Saint-Louis Hospital in Paris (SBIM).
Developed and updated by Noémie Bigot and Anouk Walter-Petrich
noemie.bigot@aphp.fr; anouk.walter-petrich@u-paris.fr

Based on The R Graph Gallery by Yan Holtz.

SBIM