This function allows to initialize a flow chart given any database. It will create a fc object showing the number of rows of the database. If a database is not available, the user can instead directly enter the number of rows in the study.
as_fc(
.data = NULL,
N = NULL,
label = "Initial dataframe",
text_pattern = "{label}\n{N}",
just = "center",
text_color = "black",
text_fs = 8,
bg_fill = "white",
border_color = "black",
hide = FALSE
)
List with the dataset and the initialized flowchart parameters.
Data frame to be initialised as a flowchart.
Number of rows of the study in case `.data` is NULL.
Character with the text that will be shown in the box.
Structure that will have the text in the box. It recognizes label, n, N and perc within brackets. For default it is "{label}\n{N}".
Justification for the text: left, center or right. Default is center.
Color of the text. It is black by default.
Font size of the text. It is 8 by default.
Box background color. It is white by default.
Box border color. It is black by default.
Logical value to hide the initial box or not. Default is FALSE. hide = TRUE can only be combined with fc_split().
clinic_patient |>
as_fc(label = "All patients") |>
fc_draw()
Run the code above in your browser using DataLab