View source: R/utils_rtables.R
| to_string_matrix | R Documentation | 
Helper function to use mostly within tests. with_spacesparameter allows
to test not only for content but also indentation and table structure.
print_txt_to_copy instead facilitate the testing development by returning a well
formatted text that needs only to be copied and pasted in the expected output.
to_string_matrix(
  x,
  widths = NULL,
  max_width = NULL,
  hsep = formatters::default_hsep(),
  with_spaces = TRUE,
  print_txt_to_copy = FALSE
)
x | 
 (  | 
widths | 
 (  | 
max_width | 
 (  | 
hsep | 
 (  | 
with_spaces | 
 (  | 
print_txt_to_copy | 
 (  | 
A matrix of strings. If print_txt_to_copy = TRUE the well formatted printout of the
table will be printed to console, ready to be copied as a expected value.
tbl <- basic_table() %>%
  split_rows_by("SEX") %>%
  split_cols_by("ARM") %>%
  analyze("AGE") %>%
  build_table(tern_ex_adsl)
to_string_matrix(tbl, widths = ceiling(propose_column_widths(tbl) / 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.