Skip to content

Feature request: Produce mock tables #142

@asbates

Description

@asbates

Description

Be able to generate mock tables where placeholders are used instead of numbers. For example instead of having 1.23 for a mean, we can build a table that has x.xx.

Example Usage

I think an argument to build would be the most natural API.


tplyr_table(adsl, TRT01P, where = SAFFL == "Y") %>% 
  add_layer(
    group_desc(AGE, by = "Age (years)")
  ) %>% 
  add_layer(
    group_count(AGEGR1, by = "Age Categories n (%)")
  ) %>% 
  build(mock = TRUE)

I could see this being problematic though because tplyr_table expects a data frame and the layers use NSE. So maybe there could be a helper function to generate a mock data set. Something like

adsl <- tplyr_mock_data(col_names = c("TRT01P", "SAFFL", "AGE", "AGEGR1"), n_rows = 10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions