cards icon indicating copy to clipboard operation
cards copied to clipboard

`cards::ard_stack()` does not work if the cards package not attached

Open ddsjoberg opened this issue 1 month ago • 0 comments

I think it may be a scoping/env issue?

# first without attaching cards
cards::ard_stack(
  data = cards::ADSL,
  by = "ARM",
  cards::ard_categorical(variables = "AGEGR1"),
  cards::ard_continuous(variables = "AGE")
)
#> Error in ard_categorical(data = structure(list(STUDYID = structure(c("CDISCPILOT01", : could not find function "ard_categorical"

# everything works if we attach cards
library(cards)
ard_stack(
  data = ADSL,
  by = "ARM",
  ard_categorical(variables = "AGEGR1"),
  ard_continuous(variables = "AGE")
)
#> {cards} data frame: 60 x 11
#>    group1 group1_level variable variable_level stat_name stat_label  stat
#> 1     ARM      Placebo   AGEGR1            <65         n          n    14
#> 2     ARM      Placebo   AGEGR1            <65         N          N    86
#> 3     ARM      Placebo   AGEGR1            <65         p          % 0.163
#> 4     ARM      Placebo   AGEGR1            >80         n          n    30
#> 5     ARM      Placebo   AGEGR1            >80         N          N    86
#> 6     ARM      Placebo   AGEGR1            >80         p          % 0.349
#> 7     ARM      Placebo   AGEGR1          65-80         n          n    42
#> 8     ARM      Placebo   AGEGR1          65-80         N          N    86
#> 9     ARM      Placebo   AGEGR1          65-80         p          % 0.488
#> 10    ARM    Xanomeli…   AGEGR1            <65         n          n    11
#> ℹ 50 more rows
#> ℹ Use `print(n = ...)` to see more rows
#> ℹ 4 more variables: context, fmt_fn, warning, error

Created on 2024-05-08 with reprex v2.1.0

ddsjoberg avatar May 09 '24 04:05 ddsjoberg