Skip to content

Commit

Permalink
add excel for download #329
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Nov 11, 2021
1 parent 2d5b81a commit 55d2f55
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ Imports:
bslib,
curl,
crlite,
lobstr
lobstr,
downloadthis
Suggests:
testthat,
subugoetheme,
Expand Down
17 changes: 13 additions & 4 deletions R/email.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added inst/mc_individual_results.xlsx
Binary file not shown.
17 changes: 17 additions & 0 deletions vignettes/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,21 @@ This is an example report using the `metacheck::doi_examples` data, shipped with
</div>
</div>

## 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

0 comments on commit 55d2f55

Please sign in to comment.