diff --git a/DESCRIPTION b/DESCRIPTION index c17ae9c4..fae9dfd0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -85,7 +85,8 @@ Imports: bslib, curl, crlite, - lobstr + lobstr, + progressr (>= 0.9.0) Suggests: testthat, subugoetheme, diff --git a/R/import.R b/R/import.R index 1d15c481..4d453373 100644 --- a/R/import.R +++ b/R/import.R @@ -58,10 +58,14 @@ looped_possibly_cr_works_field <- function(x, field, ...) { x <- biblids::as_doi(x) # remove this hackfix https://github.com/subugoe/metacheck/issues/182 x <- as.character(x) + pb <- progressr::progressor( + along = x, + message = "Querying Crossref API (works endpoint) ...", + label = "memoised_possibly_cr_works_field" + ) res <- purrr::map_chr( x, - memoised_possibly_cr_works_field, - field = field, + function(x) {pb(); memoised_possibly_cr_works_field(x, field = field, ...)}, ... ) res diff --git a/R/pretest.R b/R/pretest.R index 873be845..747c90d6 100644 --- a/R/pretest.R +++ b/R/pretest.R @@ -78,7 +78,13 @@ tabulate_metacheckable <- function(x, ...) { # create empty res object res <- tibble::tibble(doi = x) prev <- rep_len(TRUE, length(x)) + pb <- progressr::progressor( + along = lazyfuns, + message = "Running pretests ...", + label = "pretests" + ) for (i in 1:length(lazyfuns)) { + pb() curr <- lazyfuns[[i]](x, prev) res <- tibble::add_column(res, curr, .name_repair = "minimal") prev <- curr