diff --git a/DESCRIPTION b/DESCRIPTION index 5480e9b50..359d48870 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,22 +17,26 @@ Depends: R (>= 3.6), usethis (>= 2.1.6) Imports: - cli (>= 3.3.0), - desc (>= 1.4.1), + callr (>= 3.7.3), + cli (>= 3.6.0), + desc (>= 1.4.2), ellipsis (>= 0.3.2), - fs (>= 1.5.2), - lifecycle (>= 1.0.1), + fs (>= 1.6.1), + glue (>= 1.6.2), + httr (>= 1.4.5), + lifecycle (>= 1.0.3), memoise (>= 2.0.1), miniUI (>= 0.1.1.1), - pkgbuild (>= 1.3.1), - pkgdown (>= 2.0.6), - pkgload (>= 1.3.0), + pkgbuild (>= 1.4.0), + pkgdown (>= 2.0.7), + pkgload (>= 1.3.2), profvis (>= 0.3.7), rcmdcheck (>= 1.4.0), remotes (>= 2.4.2), - rlang (>= 1.0.4), - roxygen2 (>= 7.2.1), - rversions (>= 2.1.1), + rlang (>= 1.0.6), + roxygen2 (>= 7.2.3), + rstudioapi (>= 0.14), + rversions (>= 2.1.2), sessioninfo (>= 1.2.2), stats, testthat (>= 3.1.10.9000), @@ -42,7 +46,6 @@ Imports: withr (>= 2.5.0) Suggests: BiocManager (>= 1.30.18), - callr (>= 3.7.1), covr (>= 3.5.1), curl (>= 4.3.2), digest (>= 0.6.29), @@ -50,7 +53,6 @@ Suggests: foghorn (>= 1.4.2), gh (>= 1.3.0), gmailr (>= 1.0.1), - httr (>= 1.4.3), knitr (>= 1.39), lintr (>= 3.0.0), MASS, @@ -58,7 +60,6 @@ Suggests: pingr (>= 2.0.1), rhub (>= 1.1.1), rmarkdown (>= 2.14), - rstudioapi (>= 0.13), spelling (>= 2.2) VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index b9b6527f3..92756fcae 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -80,9 +80,11 @@ export(uses_testthat) export(wd) export(with_debug) import(fs) +import(rlang) importFrom(cli,cat_bullet) importFrom(cli,cat_rule) importFrom(ellipsis,check_dots_used) +importFrom(glue,glue) importFrom(lifecycle,deprecated) importFrom(memoise,memoise) importFrom(pkgbuild,clean_dll) diff --git a/R/active.R b/R/active.R index e54f893d8..2a1606591 100644 --- a/R/active.R +++ b/R/active.R @@ -18,7 +18,7 @@ find_test_file <- function(path, call = parent.frame()) { pkg <- as.package(dirname(path)) is_test <- type == "test" - path[!is_test] <- paste0(pkg$path, "/tests/testthat/test-", name_source(path[!is_test]), ".R") + path[!is_test] <- glue("{pkg$path}/tests/testthat/test-{name_source(path[!is_test])}.R") path <- unique(path[file_exists(path)]) if (length(path) == 0) { diff --git a/R/build-manual.R b/R/build-manual.R index 0c9112db2..67bf49226 100644 --- a/R/build-manual.R +++ b/R/build-manual.R @@ -9,10 +9,10 @@ build_manual <- function(pkg = ".", path = NULL) { pkg <- as.package(pkg) path <- path %||% path_dir(pkg$path) - name <- paste0(pkg$package, "_", pkg$version, ".pdf", collapse = " ") + name <- glue("{pkg$package}_{pkg$version}.pdf") tryCatch(msg <- callr::rcmd("Rd2pdf", cmdargs = c( "--force", - paste0("--output=", path, "/", name), + glue("--output={path}/{name}"), pkg$path ), fail_on_status = TRUE, stderr = "2>&1", spinner = FALSE), error = function(e) { diff --git a/R/build-readme.R b/R/build-readme.R index 174efcdc1..3d60eae99 100644 --- a/R/build-readme.R +++ b/R/build-readme.R @@ -16,7 +16,7 @@ build_rmd <- function(files, path = ".", output_options = list(), ..., quiet = T pkg <- as.package(path) - rlang::check_installed("rmarkdown") + check_installed("rmarkdown") save_all() paths <- files @@ -53,7 +53,7 @@ build_rmd <- function(files, path = ".", output_options = list(), ..., quiet = T build_readme <- function(path = ".", quiet = TRUE, ...) { pkg <- as.package(path) - regexp <- paste0(path_file(pkg$path), "/(inst/)?readme[.]rmd") + regexp <- glue("{path_file(pkg$path)}/(inst/)?readme[.]rmd") readme_path <- path_abs(dir_ls(pkg$path, ignore.case = TRUE, regexp = regexp, recurse = 1, type = "file")) if (length(readme_path) == 0) { diff --git a/R/build-site.R b/R/build-site.R index 9935963c3..0944345ac 100644 --- a/R/build-site.R +++ b/R/build-site.R @@ -10,7 +10,7 @@ #' @return NULL #' @export build_site <- function(path = ".", quiet = TRUE, ...) { - rlang::check_installed("pkgdown") + check_installed("pkgdown") save_all() diff --git a/R/check-devtools.R b/R/check-devtools.R index 96727b00e..b045375ba 100644 --- a/R/check-devtools.R +++ b/R/check-devtools.R @@ -8,7 +8,7 @@ #' @export release_checks <- function(pkg = ".", built_path = NULL) { pkg <- as.package(pkg) - cat_rule(paste0("Running additional devtools checks for ", pkg$package)) + cat_rule(glue("Running additional devtools checks for {pkg$package}")) check_version(pkg) check_dev_versions(pkg) @@ -23,13 +23,13 @@ check_dev_versions <- function(pkg = ".") { pkg <- as.package(pkg) dep_list <- pkg[tolower(remotes::standardise_dep(TRUE))] - deps <- do.call("rbind", unname(compact(lapply(dep_list, parse_deps)))) + deps <- do.call("rbind", unname(compact(map(dep_list, parse_deps)))) deps <- deps[!is.na(deps$version), , drop = FALSE] - parsed <- lapply(deps$version, function(x) unlist(numeric_version(x))) + parsed <- map(deps$version, function(x) unlist(numeric_version(x))) - lengths <- vapply(parsed, length, integer(1)) - last_ver <- vapply(parsed, function(x) x[[length(x)]], integer(1)) + lengths <- map_int(parsed, length) + last_ver <- map_int(parsed, function(x) x[[length(x)]]) is_dev <- lengths == 4 & last_ver >= 9000 @@ -52,7 +52,7 @@ check_version <- function(pkg = ".") { check_status( length(ver) == 3, "version number has three components", - paste0("version (", pkg$version, ") should have exactly three components") + glue("version ({pkg$version}) should have exactly three components") ) } @@ -66,7 +66,7 @@ check_vignette_titles <- function(pkg = ".") { any(grepl("Vignette Title", h)) } v <- stats::setNames(vigns$docs, path_file(vigns$docs)) - has_vt <- vapply(v, has_vignette_title, logical(1), n = 30) + has_vt <- map_lgl(v, has_vignette_title, n = 30) check_status( !any(has_vt), diff --git a/R/check-git.R b/R/check-git.R index d1dfe5645..59bb64d7a 100644 --- a/R/check-git.R +++ b/R/check-git.R @@ -7,7 +7,7 @@ #' @keywords internal git_checks <- function(pkg = ".") { pkg <- as.package(pkg) - cat_rule(paste0("Running Git checks for ", pkg$package)) + cat_rule(glue("Running Git checks for {pkg$package}")) git_report_branch(pkg) git_check_uncommitted(pkg) diff --git a/R/check-mac.R b/R/check-mac.R index 94dbb34c0..0e3315832 100644 --- a/R/check-mac.R +++ b/R/check-mac.R @@ -43,7 +43,7 @@ check_mac_release <- function(pkg = ".", dep_pkgs = character(), args = NULL, ma body <- list(pkgfile = httr::upload_file(built_path)) if (length(dep_built_paths) > 0) { - uploads <- lapply(dep_built_paths, httr::upload_file) + uploads <- map(dep_built_paths, httr::upload_file) names(uploads) <- rep("depfiles", length(uploads)) body <- append(body, uploads) } diff --git a/R/check-win.R b/R/check-win.R index fd735cc7e..7c5c1de50 100644 --- a/R/check-win.R +++ b/R/check-win.R @@ -86,11 +86,10 @@ check_win <- function(pkg = ".", version = c("R-devel", "R-release", "R-oldrelea ) on.exit(file_delete(built_path), add = TRUE) - url <- paste0( - "ftp://win-builder.r-project.org/", version, "/", - path_file(built_path) + url <- glue( + "ftp://win-builder.r-project.org/{version}/{path_file(built_path)}" ) - lapply(url, upload_ftp, file = built_path) + map(url, upload_ftp, file = built_path) if (!quiet) { time <- strftime(Sys.time() + 30 * 60, "%I:%M %p") @@ -127,7 +126,7 @@ change_maintainer_email <- function(path, email, call = parent.frame()) { if (!is.list(roles)) { roles <- list(roles) } - is_maintainer <- vapply(roles, function(r) all("cre" %in% r), logical(1)) + is_maintainer <- map_lgl(roles, function(r) all("cre" %in% r)) aut[is_maintainer]$email <- email desc$set_authors(aut) @@ -135,7 +134,7 @@ change_maintainer_email <- function(path, email, call = parent.frame()) { } upload_ftp <- function(file, url, verbose = FALSE) { - rlang::check_installed("curl") + check_installed("curl") stopifnot(file_exists(file)) stopifnot(is.character(url)) diff --git a/R/check.R b/R/check.R index 153a1f802..b7831cb5a 100644 --- a/R/check.R +++ b/R/check.R @@ -249,5 +249,5 @@ aspell_env_var <- function() { show_env_vars <- function(env_vars) { cli::cat_line("Setting env vars:", col = "darkgrey") - cat_bullet(paste0(format(names(env_vars)), ": ", unname(env_vars)), col = "darkgrey") + cat_bullet(glue("{format(names(env_vars))}: {unname(env_vars)}"), col = "darkgrey") } diff --git a/R/dev-mode.R b/R/dev-mode.R index ad8d18232..e5cb59d18 100644 --- a/R/dev-mode.R +++ b/R/dev-mode.R @@ -83,7 +83,7 @@ is_library <- function(path) { dirs <- dir_ls(path, type = "directory") has_pkg_dir <- function(path) length(dir_ls(path, regexp = "Meta")) > 0 - help_dirs <- vapply(dirs, has_pkg_dir, logical(1)) + help_dirs <- map_lgl(dirs, has_pkg_dir) all(help_dirs) } diff --git a/R/devtools-package.R b/R/devtools-package.R index 510dbf097..5a7416bf3 100644 --- a/R/devtools-package.R +++ b/R/devtools-package.R @@ -10,6 +10,8 @@ "_PACKAGE" ## usethis namespace: start +#' @import rlang +#' @importFrom glue glue #' @importFrom lifecycle deprecated ## usethis namespace: end NULL diff --git a/R/import-standalone-purrr.R b/R/import-standalone-purrr.R new file mode 100644 index 000000000..42e132d7e --- /dev/null +++ b/R/import-standalone-purrr.R @@ -0,0 +1,239 @@ +# Standalone file: do not edit by hand +# Source: +# ---------------------------------------------------------------------- +# +# --- +# repo: r-lib/rlang +# file: standalone-purrr.R +# last-updated: 2023-02-23 +# license: https://unlicense.org +# --- +# +# This file provides a minimal shim to provide a purrr-like API on top of +# base R functions. They are not drop-in replacements but allow a similar style +# of programming. +# +# ## Changelog +# +# 2023-02-23: +# * Added `list_c()` +# +# 2022-06-07: +# * `transpose()` is now more consistent with purrr when inner names +# are not congruent (#1346). +# +# 2021-12-15: +# * `transpose()` now supports empty lists. +# +# 2021-05-21: +# * Fixed "object `x` not found" error in `imap()` (@mgirlich) +# +# 2020-04-14: +# * Removed `pluck*()` functions +# * Removed `*_cpl()` functions +# * Used `as_function()` to allow use of `~` +# * Used `.` prefix for helpers +# +# nocov start + +map <- function(.x, .f, ...) { + .f <- as_function(.f, env = global_env()) + lapply(.x, .f, ...) +} +walk <- function(.x, .f, ...) { + map(.x, .f, ...) + invisible(.x) +} + +map_lgl <- function(.x, .f, ...) { + .rlang_purrr_map_mold(.x, .f, logical(1), ...) +} +map_int <- function(.x, .f, ...) { + .rlang_purrr_map_mold(.x, .f, integer(1), ...) +} +map_dbl <- function(.x, .f, ...) { + .rlang_purrr_map_mold(.x, .f, double(1), ...) +} +map_chr <- function(.x, .f, ...) { + .rlang_purrr_map_mold(.x, .f, character(1), ...) +} +.rlang_purrr_map_mold <- function(.x, .f, .mold, ...) { + .f <- as_function(.f, env = global_env()) + out <- vapply(.x, .f, .mold, ..., USE.NAMES = FALSE) + names(out) <- names(.x) + out +} + +map2 <- function(.x, .y, .f, ...) { + .f <- as_function(.f, env = global_env()) + out <- mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE) + if (length(out) == length(.x)) { + set_names(out, names(.x)) + } else { + set_names(out, NULL) + } +} +map2_lgl <- function(.x, .y, .f, ...) { + as.vector(map2(.x, .y, .f, ...), "logical") +} +map2_int <- function(.x, .y, .f, ...) { + as.vector(map2(.x, .y, .f, ...), "integer") +} +map2_dbl <- function(.x, .y, .f, ...) { + as.vector(map2(.x, .y, .f, ...), "double") +} +map2_chr <- function(.x, .y, .f, ...) { + as.vector(map2(.x, .y, .f, ...), "character") +} +imap <- function(.x, .f, ...) { + map2(.x, names(.x) %||% seq_along(.x), .f, ...) +} + +pmap <- function(.l, .f, ...) { + .f <- as.function(.f) + args <- .rlang_purrr_args_recycle(.l) + do.call("mapply", c( + FUN = list(quote(.f)), + args, MoreArgs = quote(list(...)), + SIMPLIFY = FALSE, USE.NAMES = FALSE + )) +} +.rlang_purrr_args_recycle <- function(args) { + lengths <- map_int(args, length) + n <- max(lengths) + + stopifnot(all(lengths == 1L | lengths == n)) + to_recycle <- lengths == 1L + args[to_recycle] <- map(args[to_recycle], function(x) rep.int(x, n)) + + args +} + +keep <- function(.x, .f, ...) { + .x[.rlang_purrr_probe(.x, .f, ...)] +} +discard <- function(.x, .p, ...) { + sel <- .rlang_purrr_probe(.x, .p, ...) + .x[is.na(sel) | !sel] +} +map_if <- function(.x, .p, .f, ...) { + matches <- .rlang_purrr_probe(.x, .p) + .x[matches] <- map(.x[matches], .f, ...) + .x +} +.rlang_purrr_probe <- function(.x, .p, ...) { + if (is_logical(.p)) { + stopifnot(length(.p) == length(.x)) + .p + } else { + .p <- as_function(.p, env = global_env()) + map_lgl(.x, .p, ...) + } +} + +compact <- function(.x) { + Filter(length, .x) +} + +transpose <- function(.l) { + if (!length(.l)) { + return(.l) + } + + inner_names <- names(.l[[1]]) + + if (is.null(inner_names)) { + fields <- seq_along(.l[[1]]) + } else { + fields <- set_names(inner_names) + .l <- map(.l, function(x) { + if (is.null(names(x))) { + set_names(x, inner_names) + } else { + x + } + }) + } + + # This way missing fields are subsetted as `NULL` instead of causing + # an error + .l <- map(.l, as.list) + + map(fields, function(i) { + map(.l, .subset2, i) + }) +} + +every <- function(.x, .p, ...) { + .p <- as_function(.p, env = global_env()) + + for (i in seq_along(.x)) { + if (!rlang::is_true(.p(.x[[i]], ...))) return(FALSE) + } + TRUE +} +some <- function(.x, .p, ...) { + .p <- as_function(.p, env = global_env()) + + for (i in seq_along(.x)) { + if (rlang::is_true(.p(.x[[i]], ...))) return(TRUE) + } + FALSE +} +negate <- function(.p) { + .p <- as_function(.p, env = global_env()) + function(...) !.p(...) +} + +reduce <- function(.x, .f, ..., .init) { + f <- function(x, y) .f(x, y, ...) + Reduce(f, .x, init = .init) +} +reduce_right <- function(.x, .f, ..., .init) { + f <- function(x, y) .f(y, x, ...) + Reduce(f, .x, init = .init, right = TRUE) +} +accumulate <- function(.x, .f, ..., .init) { + f <- function(x, y) .f(x, y, ...) + Reduce(f, .x, init = .init, accumulate = TRUE) +} +accumulate_right <- function(.x, .f, ..., .init) { + f <- function(x, y) .f(y, x, ...) + Reduce(f, .x, init = .init, right = TRUE, accumulate = TRUE) +} + +detect <- function(.x, .f, ..., .right = FALSE, .p = is_true) { + .p <- as_function(.p, env = global_env()) + .f <- as_function(.f, env = global_env()) + + for (i in .rlang_purrr_index(.x, .right)) { + if (.p(.f(.x[[i]], ...))) { + return(.x[[i]]) + } + } + NULL +} +detect_index <- function(.x, .f, ..., .right = FALSE, .p = is_true) { + .p <- as_function(.p, env = global_env()) + .f <- as_function(.f, env = global_env()) + + for (i in .rlang_purrr_index(.x, .right)) { + if (.p(.f(.x[[i]], ...))) { + return(i) + } + } + 0L +} +.rlang_purrr_index <- function(x, right = FALSE) { + idx <- seq_along(x) + if (right) { + idx <- rev(idx) + } + idx +} + +list_c <- function(x) { + inject(c(!!!x)) +} + +# nocov end diff --git a/R/lint.R b/R/lint.R index 10f9b1ac5..e8e87b910 100644 --- a/R/lint.R +++ b/R/lint.R @@ -12,7 +12,7 @@ #' @seealso [lintr::lint_package()], [lintr::lint()] #' @export lint <- function(pkg = ".", cache = TRUE, ...) { - rlang::check_installed("lintr") + check_installed("lintr") pkg <- as.package(pkg) cli::cli_inform(c(i = "Linting {.pkg {pkg$package}}")) diff --git a/R/r-hub.R b/R/r-hub.R index d3f690a8e..1da391327 100644 --- a/R/r-hub.R +++ b/R/r-hub.R @@ -36,7 +36,7 @@ check_rhub <- function(pkg = ".", interactive = TRUE, build_args = NULL, ...) { - rlang::check_installed("rhub") + check_installed("rhub") pkg <- as.package(pkg) built_path <- build(pkg$path, tempdir(), quiet = !interactive, diff --git a/R/release.R b/R/release.R index 6a62a3cfe..0f89f059a 100644 --- a/R/release.R +++ b/R/release.R @@ -69,13 +69,12 @@ release <- function(pkg = ".", check = FALSE, args = NULL) { if (show_cran_check) { if (!is.null(cran_details)) { end_sentence <- "\n shown above?" - cat_rule(paste0("Details of the CRAN check results for ", pkg$package)) + cat_rule(glue("Details of the CRAN check results for {pkg$package}")) summary(cran_details) cat_rule() } - cran_url <- paste0( - cran_mirror(), "/web/checks/check_results_", - pkg$package, ".html" + cran_url <- glue( + "{cran_mirror()}/web/checks/check_results_{pkg$package}.html" ) if (yesno("Have you fixed all existing problems at \n{cran_url}{end_sentence}")) { return(invisible()) @@ -93,8 +92,8 @@ release <- function(pkg = ".", check = FALSE, args = NULL) { deps <- if (new_pkg) 0 else length(revdep(pkg$package)) if (deps > 0) { - msg <- paste0( - "Have you checked the ", deps, " reverse dependencies ", + msg <- glue( + "Have you checked the {deps} reverse dependencies ", "(with the revdepcheck package)?" ) if (yesno(msg)) { diff --git a/R/remotes.R b/R/remotes.R index c783301dc..5f384facf 100644 --- a/R/remotes.R +++ b/R/remotes.R @@ -7,7 +7,7 @@ with_ellipsis <- function(fun) { !! b } - f <- rlang::expr_interp(f) + f <- expr_interp(f) body(fun) <- body(f) fun diff --git a/R/run-examples.R b/R/run-examples.R index cfc87fd72..7ca31dab1 100644 --- a/R/run-examples.R +++ b/R/run-examples.R @@ -58,14 +58,14 @@ run_examples <- function(pkg = ".", start = NULL, show = deprecated(), run_dontt } cat_rule( - left = paste0("Running ", length(files), " example files"), + left = glue("Running {length(files)} example files"), right = pkg$package ) load_all(pkg$path, reset = TRUE, export_all = FALSE) on.exit(load_all(pkg$path, reset = TRUE)) - lapply(files, pkgload::run_example, run_donttest = run_donttest, run_dontrun = run_dontrun) + map(files, pkgload::run_example, run_donttest = run_donttest, run_dontrun = run_dontrun) invisible() } diff --git a/R/run-source.R b/R/run-source.R index b3a0ca317..47e823551 100644 --- a/R/run-source.R +++ b/R/run-source.R @@ -30,7 +30,7 @@ #' } source_url <- function(url, ..., sha1 = NULL) { stopifnot(is.character(url), length(url) == 1) - rlang::check_installed("digest") + check_installed("digest") temp_file <- file_temp() on.exit(file_delete(temp_file), add = TRUE) @@ -108,7 +108,7 @@ check_sha1 <- function(path, sha1) { #' source_gist(6872663, filename = "hi.r", sha1 = "54f1db27e60") #' } source_gist <- function(id, ..., filename = NULL, sha1 = NULL, quiet = FALSE) { - rlang::check_installed("gh") + check_installed("gh") stopifnot(length(id) == 1) url_match <- "((^https://)|^)gist.github.com/([^/]+/)?([0-9a-f]+)$" diff --git a/R/session-info.R b/R/session-info.R index f82a3bf54..dffa1eb4e 100644 --- a/R/session-info.R +++ b/R/session-info.R @@ -20,9 +20,8 @@ loaded_packages <- function() { #' @export #' @keywords internal dev_packages <- function() { - packages <- vapply( - loadedNamespaces(), - function(x) !is.null(pkgload::dev_meta(x)), logical(1) + packages <- map_lgl( + loadedNamespaces(), function(x) !is.null(pkgload::dev_meta(x)) ) names(packages)[packages] diff --git a/R/sitrep.R b/R/sitrep.R index 27c809c24..334a774d4 100644 --- a/R/sitrep.R +++ b/R/sitrep.R @@ -46,8 +46,8 @@ check_for_rstudio_updates <- function(os = tolower(Sys.info()[["sysname"]]), return() } - nms <- vcapply(result, `[[`, 1) - values <- vcapply(result, function(x) utils::URLdecode(x[[2]])) + nms <- map_chr(result, `[[`, 1) + values <- map_chr(result, function(x) utils::URLdecode(x[[2]])) result <- stats::setNames(values, nms) diff --git a/R/spell-check.R b/R/spell-check.R index c3aa1e8e3..d005740f4 100644 --- a/R/spell-check.R +++ b/R/spell-check.R @@ -10,7 +10,7 @@ #' @param vignettes also check all `rmd` and `rnw` files in the pkg `vignettes` folder #' @param use_wordlist ignore words in the package [WORDLIST][spelling::get_wordlist] file spell_check <- function(pkg = ".", vignettes = TRUE, use_wordlist = TRUE) { - rlang::check_installed("spelling") + check_installed("spelling") pkg <- as.package(pkg) spelling::spell_check_package(pkg = pkg, vignettes = vignettes, use_wordlist = use_wordlist) } diff --git a/R/test.R b/R/test.R index 0bbe0fcc9..9b368dae5 100644 --- a/R/test.R +++ b/R/test.R @@ -91,7 +91,7 @@ load_package_for_testing <- function(pkg) { #' @export #' @rdname test test_coverage <- function(pkg = ".", show_report = interactive(), ...) { - rlang::check_installed(c("covr", "DT")) + check_installed(c("covr", "DT")) save_all() pkg <- as.package(pkg) @@ -123,7 +123,7 @@ test_coverage_active_file <- function(file = find_active_file(), show_report = interactive(), export_all = TRUE, ...) { - rlang::check_installed(c("covr", "DT")) + check_installed(c("covr", "DT")) check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn)) test_file <- find_test_file(file) diff --git a/R/utils.R b/R/utils.R index 48629a0e6..2804153ef 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,10 +1,3 @@ -compact <- function(x) { - is_empty <- vapply(x, function(x) length(x) == 0, logical(1)) - x[!is_empty] -} - -"%||%" <- function(a, b) if (!is.null(a)) a else b - "%:::%" <- function(p, f) { get(f, envir = asNamespace(p)) } @@ -26,10 +19,6 @@ is_attached <- function(pkg = ".") { !is.null(pkgload::pkg_env(pkg$package)) } -vcapply <- function(x, FUN, ...) { - vapply(x, FUN, FUN.VALUE = character(1), ...) -} - release_bullets <- function() { c( '`usethis::use_latest_dependencies(TRUE, "CRAN")`', diff --git a/R/vignettes.R b/R/vignettes.R index 1ce59746c..0c58ede59 100644 --- a/R/vignettes.R +++ b/R/vignettes.R @@ -114,13 +114,13 @@ clean_vignettes <- function(pkg = ".") { file_delete(to_remove) } - lapply(c(doc_path, meta_path), dir_delete_if_empty) + map(c(doc_path, meta_path), dir_delete_if_empty) invisible(TRUE) } dir_delete_if_empty <- function(x) { - if (dir_exists(x) && rlang::is_empty(dir_ls(x))) { + if (dir_exists(x) && is_empty(dir_ls(x))) { dir_delete(x) cli::cli_inform(c(x = "Removing {.file {path_file(x)}}")) } diff --git a/inst/WORDLIST b/inst/WORDLIST index 62007eef9..61f12634e 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -5,6 +5,7 @@ Bitbucket BugReports Bugfix CMD +CRAN's CYGWIN Cheatsheet Chun @@ -34,7 +35,9 @@ Maëlle Müller NOTEs ORCID +PBC README +RStudio RTools Rbuildignore Rcpp @@ -131,6 +134,7 @@ pre processx profvis pryr +purrr rOpenSci randomises rcmdcheck @@ -138,6 +142,7 @@ rds readme realisation reinstalls +renv repo repos revdep diff --git a/man/figures/lifecycle-archived.svg b/man/figures/lifecycle-archived.svg index 48f72a6f3..745ab0c78 100644 --- a/man/figures/lifecycle-archived.svg +++ b/man/figures/lifecycle-archived.svg @@ -1 +1,21 @@ - lifecyclelifecyclearchivedarchived \ No newline at end of file + + lifecycle: archived + + + + + + + + + + + + + + + lifecycle + + archived + + diff --git a/man/figures/lifecycle-defunct.svg b/man/figures/lifecycle-defunct.svg index 01452e5fb..d5c9559ed 100644 --- a/man/figures/lifecycle-defunct.svg +++ b/man/figures/lifecycle-defunct.svg @@ -1 +1,21 @@ -lifecyclelifecycledefunctdefunct \ No newline at end of file + + lifecycle: defunct + + + + + + + + + + + + + + + lifecycle + + defunct + + diff --git a/man/figures/lifecycle-deprecated.svg b/man/figures/lifecycle-deprecated.svg index 4baaee01c..b61c57c3f 100644 --- a/man/figures/lifecycle-deprecated.svg +++ b/man/figures/lifecycle-deprecated.svg @@ -1 +1,21 @@ -lifecyclelifecycledeprecateddeprecated \ No newline at end of file + + lifecycle: deprecated + + + + + + + + + + + + + + + lifecycle + + deprecated + + diff --git a/man/figures/lifecycle-experimental.svg b/man/figures/lifecycle-experimental.svg index d1d060e92..5d88fc2c6 100644 --- a/man/figures/lifecycle-experimental.svg +++ b/man/figures/lifecycle-experimental.svg @@ -1 +1,21 @@ -lifecyclelifecycleexperimentalexperimental \ No newline at end of file + + lifecycle: experimental + + + + + + + + + + + + + + + lifecycle + + experimental + + diff --git a/man/figures/lifecycle-maturing.svg b/man/figures/lifecycle-maturing.svg index df7131014..897370ecf 100644 --- a/man/figures/lifecycle-maturing.svg +++ b/man/figures/lifecycle-maturing.svg @@ -1 +1,21 @@ -lifecyclelifecyclematuringmaturing \ No newline at end of file + + lifecycle: maturing + + + + + + + + + + + + + + + lifecycle + + maturing + + diff --git a/man/figures/lifecycle-questioning.svg b/man/figures/lifecycle-questioning.svg index 08ee0c903..7c1721d05 100644 --- a/man/figures/lifecycle-questioning.svg +++ b/man/figures/lifecycle-questioning.svg @@ -1 +1,21 @@ -lifecyclelifecyclequestioningquestioning \ No newline at end of file + + lifecycle: questioning + + + + + + + + + + + + + + + lifecycle + + questioning + + diff --git a/man/figures/lifecycle-soft-deprecated.svg b/man/figures/lifecycle-soft-deprecated.svg new file mode 100644 index 000000000..9c166ff30 --- /dev/null +++ b/man/figures/lifecycle-soft-deprecated.svg @@ -0,0 +1,21 @@ + + lifecycle: soft-deprecated + + + + + + + + + + + + + + + lifecycle + + soft-deprecated + + diff --git a/man/figures/lifecycle-stable.svg b/man/figures/lifecycle-stable.svg index e015dc811..9bf21e76b 100644 --- a/man/figures/lifecycle-stable.svg +++ b/man/figures/lifecycle-stable.svg @@ -1 +1,29 @@ -lifecyclelifecyclestablestable \ No newline at end of file + + lifecycle: stable + + + + + + + + + + + + + + + + lifecycle + + + + stable + + + diff --git a/man/figures/lifecycle-superseded.svg b/man/figures/lifecycle-superseded.svg index 75f24f553..25211d1a6 100644 --- a/man/figures/lifecycle-superseded.svg +++ b/man/figures/lifecycle-superseded.svg @@ -1 +1,21 @@ - lifecyclelifecyclesupersededsuperseded \ No newline at end of file + + lifecycle: superseded + + + + + + + + + + + + + + + lifecycle + + superseded + +