This function allows to draw the flowchart from a fc object.
fc_draw(
object,
big.mark = "",
box_corners = "round",
arrow_angle = 30,
arrow_length = grid::unit(0.1, "inches"),
arrow_ends = "last",
arrow_type = "closed",
arrow_color = "black",
arrow_fill = "black",
arrow_lwd = 1,
arrow_lineend = "round",
arrow_linejoin = "round",
title = NULL,
title_x = 0.5,
title_y = 0.9,
title_color = "black",
title_fs = 15,
title_fface = 2,
title_ffamily = NULL,
canvas_bg = "white"
)Invisibly returns the same object that has been given to the function, with the given arguments to draw the flowchart stored in the attributes.
fc object that we want to draw.
character. Used to specify the thousands separator for patient count values. Defaults is no separator (""); if not empty used as mark between every 3 digits (ex: big.mark = "," results in 1,000 instead of 1000).
Indicator of whether to draw boxes with round ("round") vs non-round ("sharp") corners. Default is "round".
The angle of the arrow head in degrees, as in arrow.
A unit specifying the length of the arrow head (from tip to base), as in arrow.
One of "last", "first", or "both", indicating which ends of the line to draw arrow heads, as in arrow.
One of "open" or "closed" indicating whether the arrow head should be a closed triangle, as in arrow.
Color of the arrows. Default is "black". See the col parameter for gpar.
Color for filling the arrow head. Default is "black". See the fill parameter for gpar.
Line width of the arrows. Default is 1. See the lwd parameter for gpar.
Line end style for arrows. One of "round", "butt", or "square". Default is "round". See the lineend parameter for gpar.
Line join style for arrow heads (i.e., shape of arrow head corners). One of "round", "mitre", or "bevel". Default is "round". See the linejoin parameter for gpar.
The title of the flowchart. Default is NULL (no title).
x coordinate for the title. Default is 0.5.
y coordinate for the title. Default is 0.9.
Color of the title. It is "black" by default. See the col parameter for gpar.
Font size of the title. It is 15 by default. See the fontsize parameter for gpar.
Font face of the title. It is 2 by default. See the fontface parameter for gpar.
Changes the font family of the title. Default is NA. See the fontfamily parameter for gpar.
Background color for the entire canvas (the area behind the flowchart boxes). Default is "white". Set to "transparent" or NULL for a transparent background; "transparent" background will only be noticeable when exporting drawn flowcharts via fc_export() and is compatible with all fc_export() formats except "jpeg" and "bmp".
safo |>
as_fc(label = "Patients assessed for eligibility") |>
fc_filter(!is.na(group), label = "Randomized", show_exc = TRUE) |>
fc_split(group) |>
fc_filter(itt == "Yes", label = "Included in ITT") |>
fc_filter(pp == "Yes", label = "Included in PP") |>
fc_draw()
Run the code above in your browser using DataLab