I am trying to get the summary table output for one of the datasets but the output is not in the form of a tidy table
options(qwraps2_markup = "markdown")
age_summary <- list("Age" =
list("Min" = ~min(.data$Age),
"Max" = ~max(.data$Age),
"Mean" = ~mean_sd(.data$Age)))
age_tab <- summary_table(insurance, age_summary)
age_tab
When I knit the RMarkdown file, the summary table is similar to the one that comes as an output in the Console and not the expected formatted summary table.
The object generated by
qwraps2::summary_tableis a character matrix with the class attributeqwraps2_summary_table. Theqwraps2:::print.qwraps2_summary_tableandqwraps2:::print.qablemethods are responsible for the way the table is presented in the output. Chunk options will be responsible for how the table is rendered in the output document.Update: as of qwraps2 version 0.5.0 the use of the
.datais no longer needed or recommended.Take a look at the structure of
age_tableAs noted above, the object is a 3 x 1 character matrix of class
qwraps2_summary_table. To see the return in the R console:Since the
options(qwraps2_markup = "markdown")as been set, the printing method will return a markdown tableMake sure you have the
results = "asis"chunk option set in your .Rmd file so that the table will render correctly in your output document. Created on 2020-09-14 by the reprex package (v0.3.0)