Skip to content

Commit ba174a2

Browse files
committed
Updates for CRAN comments
1 parent 9a69408 commit ba174a2

File tree

8 files changed

+6
-83
lines changed

8 files changed

+6
-83
lines changed

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ importFrom(utils,available.packages)
132132
importFrom(utils,capture.output)
133133
importFrom(utils,getS3method)
134134
importFrom(utils,head)
135-
importFrom(utils,installed.packages)
136135
importFrom(utils,packageDescription)
137136
importFrom(utils,packageName)
138137
importFrom(utils,packageVersion)

R/pkg_ref_class.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ as_pkg_ref.pkg_ref <- function(x, ...) {
266266
}
267267

268268

269-
#' @importFrom utils installed.packages available.packages packageVersion
269+
#' @importFrom utils available.packages packageVersion
270270
#' @export
271271
as_pkg_ref.character <- function(x, repos = getOption("repos", "https://cran.rstudio.com"),
272272
source = NULL, lib.loc = NULL, ...) {
@@ -302,9 +302,8 @@ determine_pkg_source <- function(x, source, repos) {
302302

303303
# non-source package
304304
} else if (grepl("^[[:alpha:]][[:alnum:].]*[[:alnum:]]$", x)) {
305-
ip <- memoise_installed_packages()
306305

307-
if (x %in% ip[, "Package"]) {
306+
if (length(find.package(x, quiet = TRUE)) != 0) {
308307
return("pkg_install")
309308

310309
# if its not installed, pull the package to check it

R/utils.R

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,6 @@ firstS3method <- function(f, classes, envir = parent.frame()) {
100100
#' Defaults to \code{FALSE}, capturing the passed expression.
101101
#' @inheritParams base::sink
102102
#'
103-
#' @examples
104-
#' fn <- function() {
105-
#' print(paste(letters[1:3], collapse = ", "))
106-
#' warning("easy as")
107-
#' message(paste(1:3, collapse = ", "))
108-
#' message("simple as")
109-
#' warning("do re mi")
110-
#' return(3L)
111-
#' }
112-
#'
113-
#' capture_expr_output <- utils::getFromNamespace("capture_expr_output", "riskmetric")
114-
#' console_output <- capture_expr_output(fn())
115-
#'
116-
#' # console_output
117-
#' # > fn()
118-
#' # [1] "a, b, c"
119-
#' # Warning in fn(): easy as
120-
#' # 1, 2, 3
121-
#' # simple as
122-
#' # Warning in fn(): do re mi
123-
#' # [1] 3
124103
#'
125104
#' @importFrom utils head tail
126105
#' @return an with_eval_recording object
@@ -303,19 +282,6 @@ print.with_eval_recording <- function(x, playback = FALSE, cr = TRUE, ...,
303282
#' condition.
304283
#' @param .opts A named list of arguments to pass to \code{grepl}
305284
#' @param .envir The environment in which \code{expr} is to be evaluated
306-
#' @examples
307-
#' riskmetric:::suppressMatchingConditions({
308-
#' print(paste(letters[1:3], collapse = ", "))
309-
#' warning(structure(
310-
#' list(message = "easy as", call = NULL),
311-
#' class = c("custom_warning", "warning", "condition")))
312-
#' message(paste(1:3, collapse = ", "))
313-
#' message("simple as")
314-
#' warning("do re mi")
315-
#' },
316-
#' message = "\\d",
317-
#' custom_warning = "as$",
318-
#' warning = "\\w{2}\\s")
319285
#' @return a message printed on console
320286
#' @keywords internal
321287
suppressMatchingConditions <- function(expr, ..., .opts = list(),

R/utils_memoised.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ memoise_bioc_mirrors <- memoise::memoise({
6767

6868

6969

70-
#' @importFrom memoise memoise
71-
memoise_installed_packages <- memoise::memoise({
72-
function(...) utils::installed.packages(...)
73-
})
74-
75-
76-
7770
#' @importFrom memoise memoise
7871
memoise_available_packages <- memoise::memoise({
7972
Sys.sleep(20)

R/zzz.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@
1818
# if non-interactive, cache package sources on load
1919
if (!interactive()) {
2020
memoise_available_packages()
21-
memoise_installed_packages()
2221
}
2322
}

cran-comments.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Submission 2
2+
3+
Per comments from Gregor Seyer, the use of installed.packages was replaced with find.package. Examples for unexported functions were also removed.
4+
15
## Test environments
26
* local R installation, R 3.6.2
37
* local R installation, R 3.6.2

man/capture_expr_output.Rd

Lines changed: 0 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/suppressMatchingConditions.Rd

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)