From a6d92a3083c2aa3e341bcf8bf820db559f7b94f9 Mon Sep 17 00:00:00 2001 From: Dimitri Baptiste <55843498+ddbaptiste@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:48:57 -0500 Subject: [PATCH 1/3] [bugfix] address error in `vapply()` in `ensure_packages()` --- R/utils.R | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/R/utils.R b/R/utils.R index d150c74..debcd25 100644 --- a/R/utils.R +++ b/R/utils.R @@ -4,10 +4,10 @@ ## Created: 2025-11-05 ## ## Author: Dimitri Baptiste ## ## ----- ## -## Last Modified: 2025-11-05 ## +## Last Modified: 2026-01-20 ## ## Modified By: Dimitri Baptiste ## ## ----- ## -## Copyright (c) 2025 Syndemics Lab at Boston Medical Center ## +## Copyright (c) 2025-2026 Syndemics Lab at Boston Medical Center ## ################################################################################ #' Ensure required packages are installed @@ -16,13 +16,14 @@ #' A method that installs packages from CRAN, if they're not yet installed in #' the current environment, and loads packages. #' -#' @param packages Character vector of required packages +#' @param ... Package names as strings #' @return A logical vector giving `TRUE` if the package is installed and #' available and `FALSE` if there was an issue with installing each of the #' specified packages #' @examples -#' ensure_packages(c("dplyr", "here")) -ensure_packages <- function(packages) { +#' ensure_packages("dplyr", "here") +ensure_packages <- function(...) { + packages <- c(...) return(vapply( packages, function(package) { @@ -35,6 +36,6 @@ ensure_packages <- function(packages) { library(package, character.only = TRUE, warn.conflicts = FALSE) return(require(package, character.only = TRUE)) }, - logical(length(packages)) + logical(1) )) } From 0cec1afa19467af3dbac4195c65d0067ca6808d9 Mon Sep 17 00:00:00 2001 From: Dimitri Baptiste <55843498+ddbaptiste@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:51:42 -0500 Subject: [PATCH 2/3] Include changes from stale branch - Add `.editorconfig`, remove `R/.gitkeep` --- .Rprofile | 1 + .editorconfig | 8 ++++++++ R/.gitkeep | 0 3 files changed, 9 insertions(+) create mode 100644 .editorconfig delete mode 100644 R/.gitkeep diff --git a/.Rprofile b/.Rprofile index 81b960f..7ca3eb9 100644 --- a/.Rprofile +++ b/.Rprofile @@ -1 +1,2 @@ source("renv/activate.R") +source("R/utils.R") diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d4aeef6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +end_of_line = lf +indent_style = space + +[*.R] +indent_size = 4 \ No newline at end of file diff --git a/R/.gitkeep b/R/.gitkeep deleted file mode 100644 index e69de29..0000000 From 623321eb0cb95f8947c11ef2228c85c9ccf0b3cf Mon Sep 17 00:00:00 2001 From: Dimitri Baptiste <55843498+ddbaptiste@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:59:33 -0500 Subject: [PATCH 3/3] Untrack `.editorconfig` --- .editorconfig | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d4aeef6..0000000 --- a/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -root = true - -[*] -end_of_line = lf -indent_style = space - -[*.R] -indent_size = 4 \ No newline at end of file