View source: R/order_swimlane.R
order_swimlane | R Documentation |
Assigns factor levels to an identifying key in a tibble (often subject ID) by a second variable (often study duration), with the option to perform this sorting within groups. Most often used before a call to ggplot() + geom_swimlane()
order_swimlane(.data, id_var, order_by, order_within = NULL)
.data |
A tibble or data.frame |
id_var |
Row (often subject) ID |
order_by |
Variable to sort by, often time on study |
order_within |
Variable to sort within, often cohort |
A tibble with id_var
as a releveled factor
patient_disposition %>% order_swimlane(subject, weeks_on_study, cohort)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.