Data can be in the long format or in the
wide format:
base_long
base_wide
record_id Trial ID
record_id Trial ID
start Start date of enrollment
start_exp, start_ctrl Start
date of enrollment for exp & ctrl arms
end End date of enrollment
end_exp, end_ctrl End date of
enrollment for exp & ctrl arms
arm Arm : exp or ctrl
group Group
group Group
prim_endp Primary endpoint : Positive/
Negative/ Unclear/ No PE defined
prim_endp Primary endpoint : Positive/
Negative/ Unclear/ No PE defined
record_id
start
end
arm
group
prim_endp
1
2015
2020
exp
Balancing-based methods
Positive
1
2016
2020
ctrl
Balancing-based methods
Positive
2
2020
NA
exp
Balancing-based methods
No PE defined
2
2019
2020
ctrl
Balancing-based methods
No PE defined
record_id
start_exp
end_exp
start_ctrl
end_ctrl
group
prim_endp
1
2015
2020
2016
2020
Balancing-based methods
Positive
2
2020
NA
2019
2020
Balancing-based methods
No PE defined
3
2017
2020
NA
NA
Non-balancing methods
Positive
4
NA
NA
2003
2018
Balancing-based methods
Positive
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) ... )
enrollment_period_plot function
Download
enrollment_period_plot.R enrollment_period_plot( baz_wide = "NULL", data frame in wide format (max one
control for one experimental): - required variables: record_id,
start_exp, end_exp, start_ctrl, end_ctrl - optional variables:
group, prim_endp baz_long = "NULL", data frame in long
format: - required variables: record_id, start, end, arm -
optional variables: group, prim_endp group_filter = "NULL", character value of group used for
filtering title = "NULL", plot title subtitle = "NULL", plot subtitle barwidth = "0.3", bar width (to reduce the width of the
bars) x_lab = "Year", x-axis label y_lab = "Record ID", y-axis label )
Contact
This document is a work of the statistics team in the Biostatistics and Medical Information Department at Saint-Louis Hospital in Paris (SBIM). This site was developed by Emma Lafaurie. Actual development and updating by Noémie Bigot and Anouk Walter-Petrich noemie.bigot@aphp.fr; anouk.walter-petrich@u-paris.fr.