diff --git a/R/markdown-state.R b/R/markdown-state.R index e02f748a..ac2e8b05 100644 --- a/R/markdown-state.R +++ b/R/markdown-state.R @@ -25,7 +25,7 @@ local_markdown <- function(env = parent.frame()) { markdown_activate <- function(tags) { ## markdown on/off based on global flag and presence of @md & @nomd - names <- purrr::map_chr(tags, "tag") + names <- map_chr(tags, "tag") has_md <- "md" %in% names has_nomd <- "noMd" %in% names diff --git a/R/rd-r6.R b/R/rd-r6.R index 2aa5cb53..812f0c2c 100644 --- a/R/rd-r6.R +++ b/R/rd-r6.R @@ -119,7 +119,7 @@ r6_fields <- function(block, r6data) { fields <- self$name[self$type == "field"] active <- self$name[self$type == "active"] - tags <- purrr::keep( + tags <- keep( block$tags, function(t) t$tag == "field" && ! t$val$name %in% active ) @@ -165,7 +165,7 @@ r6_active_bindings <- function(block, r6data) { fields <- self$name[self$type == "field"] active <- self$name[self$type == "active"] - tags <- purrr::keep( + tags <- keep( block$tags, function(t) t$tag == "field" && ! t$val$name %in% fields ) @@ -313,7 +313,7 @@ r6_method_begin <- function(block, method) { } r6_method_description <- function(block, method) { - det <- purrr::keep(method$tags[[1]], function(t) t$tag == "description") + det <- keep(method$tags[[1]], function(t) t$tag == "description") # Add an empty line between @description tags, if there isn't one # there already txt <- map_chr(det, "val") @@ -340,7 +340,7 @@ r6_method_usage <- function(block, method) { } r6_method_details <- function(block, method) { - det <- purrr::keep(method$tags[[1]], function(t) t$tag == "details") + det <- keep(method$tags[[1]], function(t) t$tag == "details") # Add an empty line between @details tags, if there isn't one # there already txt <- map_chr(det, "val") @@ -354,7 +354,7 @@ r6_method_details <- function(block, method) { } r6_method_params <- function(block, method) { - par <- purrr::keep(method$tags[[1]], function(t) t$tag == "param") + par <- keep(method$tags[[1]], function(t) t$tag == "param") nms <- gsub(",", ", ", map_chr(par, c("val", "name"))) # Each arg should appear exactly once @@ -414,7 +414,7 @@ r6_method_params <- function(block, method) { } r6_method_return <- function(block, method) { - ret <- purrr::keep(method$tags[[1]], function(t) t$tag == "return") + ret <- keep(method$tags[[1]], function(t) t$tag == "return") if (length(ret) == 0) return() if (length(ret) > 1) { warn_roxy_block(block, "Must use one @return per R6 method") @@ -428,7 +428,7 @@ r6_method_return <- function(block, method) { } r6_method_examples <- function(block, method) { - exa <- purrr::keep(method$tags[[1]], function(t) t$tag == "examples") + exa <- keep(method$tags[[1]], function(t) t$tag == "examples") if (length(exa) == 0) return() txt <- map_chr(exa, "val") @@ -455,7 +455,7 @@ r6_all_examples <- function(block, methods) { unlist(lapply( seq_len(nrow(methods)), function(i) { - exa <- purrr::keep(methods$tags[[i]], function(t) t$tag == "examples") + exa <- keep(methods$tags[[i]], function(t) t$tag == "examples") if (length(exa) == 0) return() name <- paste0(block$object$alias, "$", r6_show_name(methods$name[i])) c( diff --git a/R/rd.R b/R/rd.R index d4e828c2..eb8f342d 100644 --- a/R/rd.R +++ b/R/rd.R @@ -89,7 +89,7 @@ roclet_output.roclet_rd <- function(x, results, base_path, ..., is_first = FALSE roclet_clean.roclet_rd <- function(x, base_path) { rd <- dir(file.path(base_path, "man"), full.names = TRUE) rd <- rd[!file.info(rd)$isdir] - unlink(purrr::keep(rd, made_by_roxygen)) + unlink(keep(rd, made_by_roxygen)) } # Does this block get an Rd file? diff --git a/R/roxygenize.R b/R/roxygenize.R index 6440570a..be62371a 100644 --- a/R/roxygenize.R +++ b/R/roxygenize.R @@ -82,7 +82,7 @@ roxygenize <- function(package.dir = ".", base_path = base_path ) - out <- purrr::map2( + out <- map2( roclets, results, roclet_output, base_path = base_path,