1515# ' * `use_tidy_eval()`: imports a standard set of helpers to facilitate
1616# ' programming with the tidy eval toolkit.
1717# '
18+ # ' * `use_tidy_versions()`: pins all dependencies to require at least
19+ # ' the currently installed version.
20+ # '
1821# ' @md
1922# ' @name tidyverse
2023NULL
@@ -69,6 +72,10 @@ use_tidy_description <- function() {
6972}
7073
7174
75+ # ' @export
76+ # ' @rdname tidyverse
77+ # ' @param overwrite By default (`FALSE`), only dependencies without version
78+ # ' specifications will be modified. Set to `TRUE` to modify all dependencies.
7279use_tidy_versions <- function (overwrite = FALSE ) {
7380 deps <- desc :: desc_get_deps(proj_get())
7481
@@ -77,7 +84,7 @@ use_tidy_versions <- function(overwrite = FALSE) {
7784 to_change <- to_change & deps $ version == " *"
7885 }
7986
80- deps $ version [to_change ] <- purrr :: map_chr (deps $ package [to_change ], dep_version )
87+ deps $ version [to_change ] <- vapply (deps $ package [to_change ], dep_version , character ( 1 ) )
8188 desc :: desc_set_deps(deps , file = proj_get())
8289
8390 invisible (TRUE )
@@ -87,7 +94,7 @@ is_installed <- function(x) {
8794 length(find.package(x , quiet = TRUE )) > 0
8895}
8996dep_version <- function (x ) {
90- if (is_installed(x )) paste0(" >= " , packageVersion(x )) else " *"
97+ if (is_installed(x )) paste0(" >= " , utils :: packageVersion(x )) else " *"
9198}
9299
93100
0 commit comments