Closed ddsjoberg closed 4 months ago
At first look, it seems they work well. But should do some more testing and add unit tests so we don't accidentally break it in the future.
tbl_continuous()
library(cards) ADSL |> dplyr::mutate(`Age Group` = AGEGR1) |> ard_categorical(variables = `Age Group`) |> head(2) #> {cards} data frame: 2 x 9 #> variable variable_level context stat_name stat_label statistic #> 1 Age Group <65 categori… n n 33 #> 2 Age Group <65 categori… N N 254 #> ℹ 3 more variables: statistic_fmt_fn, warning, error ADSL |> dplyr::mutate(`Age Group` = AGEGR1) |> ard_categorical(variables = "Age Group") |> head(2) #> {cards} data frame: 2 x 9 #> variable variable_level context stat_name stat_label statistic #> 1 Age Group <65 categori… n n 33 #> 2 Age Group <65 categori… N N 254 #> ℹ 3 more variables: statistic_fmt_fn, warning, error ADSL |> dplyr::mutate(`Patient Age` = AGE) |> ard_continuous(variables = `Patient Age`) |> head(2) #> {cards} data frame: 2 x 8 #> variable context stat_name stat_label statistic statistic_fmt_fn #> 1 Patient Age continuo… N N 254 0 #> 2 Patient Age continuo… mean Mean 75.087 1 #> ℹ 2 more variables: warning, error ADSL |> dplyr::mutate(`Patient Age` = AGEGR1) |> ard_continuous(variables = "Patient Age") |> head(2) #> {cards} data frame: 2 x 8 #> variable context stat_name stat_label statistic warning #> 1 Patient Age continuo… N N 254 #> 2 Patient Age continuo… mean Mean NA argument… #> ℹ 2 more variables: statistic_fmt_fn, error
Created on 2024-02-11 with reprex v2.1.0
At first look, it seems they work well. But should do some more testing and add unit tests so we don't accidentally break it in the future.
tbl_continuous()
have non-syntactic names? Or named list inputs, like the formatting functions and statistic labels, etc.Created on 2024-02-11 with reprex v2.1.0