Skip to content

Commit 2f971a8

Browse files
Use rlang::is_installed
1 parent b7ad523 commit 2f971a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

R/transform-code.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,8 @@ get_knitr_pattern <- function(filetype) {
171171
if (!filetype %in% c("Rnw", "Rmd")) {
172172
return(NULL)
173173
}
174-
stopifnot(
175-
`{knitr} is required to process vignette files (Rmd, Rnw)` =
176-
requireNamespace("knitr", quietly = TRUE)
177-
)
174+
if (!rlang::is_installed("knitr")) {
175+
rlang::abort("{knitr} is required to process vignette files (Rmd, Rnw)")
176+
}
178177
knitr::all_patterns[[if (filetype == "Rnw") "rnw" else "md"]]
179178
}

0 commit comments

Comments
 (0)