diff --git a/DESCRIPTION b/DESCRIPTION index 8d9c2f5d..09a92ce1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -85,7 +85,8 @@ Imports: bslib, curl, crlite, - lobstr + lobstr, + downloadthis Suggests: testthat, subugoetheme, diff --git a/R/email.R b/R/email.R index ab411d86..f15b1447 100644 --- a/R/email.R +++ b/R/email.R @@ -407,16 +407,25 @@ md_data_attachment <- function(dois, dois[is_metacheckable(dois)] )), path = fs::file_temp(ext = "xlsx")) { + df <- md_data_attachment_df(dois, df) + writexl::write_xlsx( + x = df, + path = path + ) +} + +#' @describeIn md_data_attachment Generate DF +md_data_attachment_df <- function(dois, + df = cr_compliance_overview(get_cr_md( + dois[is_metacheckable(dois)] + ))) { is_compliance_overview_list(df) df[["pretest"]] <- tibble::tibble( # writexl does not know vctrs records doi = as.character(biblids::as_doi(dois)), tabulate_metacheckable(dois) ) - writexl::write_xlsx( - x = df, - path = path - ) + df } #' Data is available diff --git a/inst/mc_individual_results.xlsx b/inst/mc_individual_results.xlsx new file mode 100644 index 00000000..049d3dfb Binary files /dev/null and b/inst/mc_individual_results.xlsx differ diff --git a/vignettes/report.Rmd b/vignettes/report.Rmd index c26d99d4..6e815a14 100644 --- a/vignettes/report.Rmd +++ b/vignettes/report.Rmd @@ -43,4 +43,21 @@ This is an example report using the `metacheck::doi_examples` data, shipped with +## Individual Results + +`r metacheck::mc_long_docs_string("table.md", lang = "en")` + +```{r, echo = FALSE} +downloadthis::download_file( + path = system.file("mc_individual_results.xlsx", package = "metacheck"), + output_name = "Individual Results as an Excel Spreadsheet", + button_label = "Individual Results as an Excel Spreadsheet", + button_type = "danger", + has_icon = TRUE, + icon = "fa fa-save", + self_contained = FALSE +) +``` + + ## References