diff --git a/R/helpers--make_unique_obj_names.R b/R/helpers--make_unique_obj_names.R index aa4d28db..cdecabdb 100644 --- a/R/helpers--make_unique_obj_names.R +++ b/R/helpers--make_unique_obj_names.R @@ -1,6 +1,8 @@ make_unique_obj_names <- function(names, prefix = "", suffix = "", - list_of_choices = objects(all.names = TRUE, - envir = .GlobalEnv), + list_of_choices = objects( + all.names = TRUE, + envir = .GlobalEnv + ), all_numbered = TRUE) { if (length(names) == 0) { return(NULL) diff --git a/R/helpers.R b/R/helpers.R index 4902440e..2cad8546 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -34,9 +34,9 @@ ui_msg_restart_rstudio <- function() { } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # str_glue_eval ============================================================== -str_glue_eval <- function(..., envir = parent.frame(), .sep = "", - .open = "{", .close = "}", envir_eval = envir, envir_glue = envir) { - +str_glue_eval <- function( + ..., envir = parent.frame(), .sep = "", + .open = "{", .close = "}", envir_eval = envir, envir_glue = envir) { commands_as_text <- glue::glue(..., .envir = envir_glue, .open = .open, diff --git a/R/packages--find.R b/R/packages--find.R index 8e9c0ccf..c23cf88a 100644 --- a/R/packages--find.R +++ b/R/packages--find.R @@ -57,7 +57,7 @@ list_pkgs_used_in_dir_code <- function(path = ".", regexp = "(?i)[.](rmd|r)$", . # TODO: ignore code in comments list_pkgs_used_in_files <- function(files) { files %>% - purrr::map(~readr::read_file(.)) %>% + purrr::map(~ readr::read_file(.)) %>% stringr::str_extract_all( paste0( "(?<=(library|require|require2)\\()(.*?)(?=\\))|", # library(dplyr) @@ -74,10 +74,10 @@ list_pkgs_used_in_files <- function(files) { list_pkgs_used_in_files_code <- function(files) { files %>% - purrr::map(~readr::read_file(.)) %>% + purrr::map(~ readr::read_file(.)) %>% stringr::str_extract_all( paste0( - "(library|require|require2)\\((.*?)\\)|", # library(dplyr) + "(library|require|require2)\\((.*?)\\)|", # library(dplyr) "(\\s|\\n|\\(|\\{|\\[)[a-zA-Z0-9.]*?( )*:{2,3}[a-zA-Z0-9._]*|", # dplyr::select "package\\s*=\\s*(\"|')[a-zA-Z0-9.]*?(\"|')" # data(package = "dplyr") ) @@ -90,7 +90,6 @@ list_pkgs_used_in_files_code <- function(files) { get_pkg_dependencies <- function(pkg) { pkg <- stringr::str_replace(pkg, "[.]", "[.]") desc::desc_get_deps(fs::dir_ls(.libPaths(), regexp = glue::glue("/{pkg}$"))) %>% - dplyr::filter(.data$type %in% c("Depends", "Imports")) %>% - dplyr::pull(.data$package) + dplyr::filter(.data$type %in% c("Depends", "Imports")) %>% + dplyr::pull(.data$package) } - diff --git a/R/restart_reload.R b/R/restart_reload.R index 40adc65b..25670622 100644 --- a/R/restart_reload.R +++ b/R/restart_reload.R @@ -10,7 +10,7 @@ #' @concept utilities #' rstudio_restart_r <- function() { - if (rstudioapi::isAvailable(version_needed = "1.2.1261") ) { + if (rstudioapi::isAvailable(version_needed = "1.2.1261")) { invisible(rstudioapi::executeCommand("restartR", quiet = TRUE)) } } @@ -19,7 +19,7 @@ rstudio_restart_r <- function() { #' @export #' @concept utilities rstudio_reload_ui <- function() { - if (rstudioapi::isAvailable(version_needed = "1.2.1261") ) { + if (rstudioapi::isAvailable(version_needed = "1.2.1261")) { invisible(rstudioapi::executeCommand("reloadUi", quiet = TRUE)) } } @@ -35,4 +35,3 @@ restart_r <- function() { restart_rstudio <- function() { rstudio_restart_r() } - diff --git a/README.Rmd b/README.Rmd index 9f9849c7..c4776cc0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -110,7 +110,7 @@ Options: ```{r README-7a, eval=FALSE} bio::check_installed_programs() ## ✔ Program R (4.3.1) is installed (recommended >= 4.3.1). -## ✖ Program RStudio is not installed or is not running. +## ✖ Program RStudio is not installed or is not running. ## ✔ Tool Quarto (1.4.268) is installed (recommended >= 1.3.336). ## ✔ Tool Rtools is installed. ``` @@ -157,13 +157,13 @@ cat(res) ```{r README-8a, eval=FALSE, paged.print=FALSE} bio::check_packages_by_topic("mini") -## ℹ Reading list 'mini' +## ℹ Reading list 'mini' ## ✔ Minimal required versions of all 19 packages (from list 'mini') are already installed. ``` ```{r README-8b, eval=FALSE, paged.print=FALSE} bio::check_packages_by_topic("mini", include = "newer_on_cran") -## ℹ Reading list 'mini' +## ℹ Reading list 'mini' ## ✔ Minimal required versions of all 19 packages (from list 'mini') are already installed. ## ℹ Note: 1 package has newer version on CRAN. ``` @@ -186,9 +186,9 @@ Check if there are updates for **bio** or its dependency packages. ```{r README-3b, eval=FALSE, paged.print=FALSE} bio::check_updates_pkg_bio() ## ℹ Analyzing dependencies of package bio -## +## ## [... truncated ...] -## +## ## ✔ Minimal required versions of all 26 packages (from list 'bio') are already installed. ``` @@ -221,7 +221,7 @@ bio::rstudio_install_spellcheck_dictionaries() Install improved Lithuanian dictionary. ```{r eval=FALSE} bio::rstudio_install_spellcheck_dictionary_lt() -## ✔ lt_LT dictionary installed. +## ✔ lt_LT dictionary installed. ## 'C:/Users/ViG/AppData/Roaming/RStudio/dictionaries/languages-system/lt_LT.dic' ``` @@ -348,7 +348,7 @@ snippets::install_snippets_from_package("snippets", backup = TRUE) ## 'C:/Users/User/AppData/Roaming/RStudio/snippets/markdown.snippets' ## ✔ File with r snippets was updated: ## 'C:/Users/User/AppData/Roaming/RStudio/snippets/r.snippets' -## +## ## ℹ You will be able to use the snippets after RStudio is closed and reopened. ```