brad-cannell / codebookr

Create Codebooks From Data Frames
https://brad-cannell.github.io/codebookr/
Other
25 stars 5 forks source link

Allow users to pass their own summary functions to codebook #31

Open mbcann01 opened 1 year ago

mbcann01 commented 1 year ago

Overview

I think it would be cool if users could eventually add their own summary functions to codebook(). The defaults could look something like this, perhaps:

codebook(
  df,
  title = NA,
  subtitle = NA,
  description = NA,
  keep_blank_attributes = FALSE,
  no_summary_stats = NULL,
  digits = 2,
  # This is the part where users can enter their own summary stat functions
  # Will also need to include flextable formatting functions.
  summary_stats_fns = list(
    numeric = cb_summary_stats_numeric(),
    many_cats = cb_summary_stats_many_cats(),
    few_cats = cb_summary_stats_few_cats(),
    time = cb_summary_stats_time()
  )
)

Task list