insightsengineering / cards

CDISC Analysis Results Data
https://insightsengineering.github.io/cards/
24 stars 0 forks source link

Bug: `print(n_col)` argument not working #215

Closed ddsjoberg closed 2 months ago

ddsjoberg commented 3 months ago

In the example below, I am trying to print all columns using n_col = Inf, but still getting a subset.

Additionally, I think we should add the experimental tag to the help file for this method to signal that we may update it. I don't love the current implementation (two arguments to control column printing, would prefer a print method that detects output width and prints the correct number of columns that can fit in the windows, etc.)

library(cards)

ard_continuous(ADSL, variables = AGE) |> 
  apply_fmt_fn() |> 
  print(n_col = Inf)
#> {cards} data frame: 8 x 9
#>   variable   context stat_name stat_label   stat stat_fmt fmt_fn
#> 1      AGE continuo…         N          N    254      254      0
#> 2      AGE continuo…      mean       Mean 75.087     75.1      1
#> 3      AGE continuo…        sd         SD  8.246      8.2      1
#> 4      AGE continuo…    median     Median     77     77.0      1
#> 5      AGE continuo…       p25  25th Per…     70     70.0      1
#> 6      AGE continuo…       p75  75th Per…     81     81.0      1
#> 7      AGE continuo…       min        Min     51     51.0      1
#> 8      AGE continuo…       max        Max     89     89.0      1
#> ℹ 2 more variables: warning, error

Created on 2024-03-24 with reprex v2.1.0