From 91ad59d6b25421ee7e1d252587708d5183d0c0b4 Mon Sep 17 00:00:00 2001 From: Abel Vertesy Date: Tue, 1 Sep 2026 12:08:53 +0200 Subject: [PATCH 1/2] Bump package version to 2.9.1 Updates the package metadata to 2.9.1 and refreshes generated docs. The change also adjusts the package build script formatting and cleans up a few roxygen-generated references in the man pages. --- CITATION.cff | 2 +- DESCRIPTION | 8 ++--- Development/Create_the_CodeAndRoll2_Package.R | 30 ++++++++++++------- Development/config.R | 2 +- R/CodeAndRoll2.R | 5 ++-- man/df.remove.empty.rows.and.columns.Rd | 2 +- man/imovingSEM.Rd | 2 +- man/movingAve.Rd | 8 ++--- man/movingAve2.Rd | 2 +- 9 files changed, 36 insertions(+), 25 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index e33875f..5379501 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,6 +1,6 @@ cff-version: 1.2.0 title: An R package of over 170 productivity functions, including vector, matrix and list manipulations; math; flow logic; etc. -version: v2.8.0 +version: v2.9.1 message: >- If you use this software, please cite it using these metadata. type: software diff --git a/DESCRIPTION b/DESCRIPTION index 57761fe..f4af36d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: CodeAndRoll2 Title: CodeAndRoll2 for vector, matrix and list manipulations -Version: 2.8.15 +Version: 2.9.1 Authors@R: person("Abel", "Vertesy", , "av@imba.oeaw.ac.at", role = c("aut", "cre")) Description: CodeAndRoll2 is a set of more than 170 productivity functions @@ -10,7 +10,7 @@ License: GPL-3 + file LICENSE BugReports: https://github.com/vertesy/CodeAndRoll2/issues Depends: Stringendo -Imports: +Imports: colorRamps, dplyr, gplots, @@ -23,11 +23,11 @@ Imports: sessioninfo, stringr, tibble -Suggests: +Suggests: ggExpress, grDevices, sm Encoding: UTF-8 -Packaged: 2026-08-25 16:08:37.620754 +Packaged: 2026-09-01 12:04:47.803946 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 diff --git a/Development/Create_the_CodeAndRoll2_Package.R b/Development/Create_the_CodeAndRoll2_Package.R index 17f6b9c..64efade 100644 --- a/Development/Create_the_CodeAndRoll2_Package.R +++ b/Development/Create_the_CodeAndRoll2_Package.R @@ -21,6 +21,19 @@ source(config.path) # Install your package ------------------------------------------------ devtools::check_man(repository.dir) + +# Automated Codebase linting to tidyverse style ------------------------------------------------ +styler::style_pkg(repository.dir) + + +# Replaces T with TRUE and F with FALSE ------------------------------------------------ +devtools::load_all("~/GitHub/Packages/PackageTools") +(ls.scripts.full.path <- list.files(file.path(repository.dir, "R"), full.names = T, pattern = '.R$')) +for (scriptX in ls.scripts.full.path) { + PackageTools::replace_tf_with_true_false(scriptX) + PackageTools::replace_short_calls(scriptX) +} + PackageTools::document_and_create_package(repository.dir, config_file = 'config.R') 'git add commit push to remote' @@ -44,9 +57,14 @@ checkres <- devtools::check(repository.dir, cran = FALSE) -# Automated Codebase linting to tidyverse style ------------------------------------------------ -styler::style_pkg(repository.dir) +# Replaces T with TRUE and F with FALSE ------------------------------------------------ +devtools::load_all("~/GitHub/Packages/PackageTools") +(ls.scripts.full.path <- list.files(file.path(repository.dir, "R"), full.names = T, pattern = '.R$')) +for (scriptX in ls.scripts.full.path) { + PackageTools::replace_tf_with_true_false(scriptX) + PackageTools::replace_short_calls(scriptX) +} # Extract package dependencies ------------------------------------------------ PackageTools::extract_package_dependencies(repository.dir) @@ -92,14 +110,6 @@ PackageTools::copy_github_badge("active") # Add badge to readme via clipboard file.edit(paste0(repository.dir, "README.md")) -# Replaces T with TRUE and F with FALSE ------------------------------------------------ -(ls.scripts.full.path <- list.files(file.path(repository.dir, "R"), full.names = T, pattern = '.R$')) -for (scriptX in ls.scripts.full.path) { - PackageTools::replace_tf_with_true_false(scriptX) - PackageTools::replace_short_calls(scriptX) -} - - diff --git a/Development/config.R b/Development/config.R index ee34ab1..df5b0ea 100644 --- a/Development/config.R +++ b/Development/config.R @@ -3,7 +3,7 @@ DESCRIPTION <- list( package.name = "CodeAndRoll2", - version = "2.8.15", + version = "2.9.1", title = "CodeAndRoll2 for vector, matrix and list manipulations", description = "CodeAndRoll2 is a set of more than 170 productivity functions for vector, matrix and list manipulations and math. Used by MarkdownReports, ggExpress, SeuratUtils, etc.", diff --git a/R/CodeAndRoll2.R b/R/CodeAndRoll2.R index 23e6bea..b8dc1cf 100644 --- a/R/CodeAndRoll2.R +++ b/R/CodeAndRoll2.R @@ -179,7 +179,8 @@ savehistory_2rstudio <- function(history_file = "~/.local/share/rstudio/history_ #' } #' #' @export -savehistory_Rhist <- function() { current_dir <- getwd() +savehistory_Rhist <- function() { + current_dir <- getwd() # Construct the file name using the current date and optionally the file name from RStudio script_name <- try(basename(rstudioapi::getSourceEditorContext()$path), silent = TRUE) @@ -2503,7 +2504,7 @@ get_max_colname_per_row <- function( if (na.remove) mat[is.na(mat)] <- -Inf # Function to find the maximum indices (1 or more ) of values in a vector - .which.max.multi = function (x) which(x == max(x, na.rm = TRUE)) # unique formatting needed to avoid pattern matching. + .which.max.multi = function(x) which(x == max(x, na.rm = TRUE)) # unique formatting needed to avoid pattern matching. # Apply function to find the maximum indices to each row and return appropriate result max_indices_per_row <- lapply(seq_len(nrow(mat)), function(i) .which.max.multi(mat[i, ])) diff --git a/man/df.remove.empty.rows.and.columns.Rd b/man/df.remove.empty.rows.and.columns.Rd index 2c0f132..53127b7 100644 --- a/man/df.remove.empty.rows.and.columns.Rd +++ b/man/df.remove.empty.rows.and.columns.Rd @@ -6,7 +6,7 @@ \usage{ df.remove.empty.rows.and.columns( df, - suffix = substitute_deparse(df), + suffix = Stringendo::substitute_deparse(df), rows = "rows", cols = "cols", thr.cell.empty = 0, diff --git a/man/imovingSEM.Rd b/man/imovingSEM.Rd index 1fc03cc..3fba690 100644 --- a/man/imovingSEM.Rd +++ b/man/imovingSEM.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CodeAndRoll2.R \name{imovingSEM} \alias{imovingSEM} -\title{imovingSEM [Deprecated]} +\title{imovingSEM \link{Deprecated}} \usage{ imovingSEM(x, oneSide = 5) } diff --git a/man/movingAve.Rd b/man/movingAve.Rd index 4890303..7ae0bbb 100644 --- a/man/movingAve.Rd +++ b/man/movingAve.Rd @@ -19,10 +19,10 @@ A vector of the same length as \code{x}, containing the moving average for each } \description{ Calculates the moving / rolling average of a numeric vector. The window around -element \code{i} spans \code{oneSide} elements on either side (window width \code{2 * oneSide + 1}). -Near the edges of \code{x}, the window either shrinks to whatever data is available -(\code{partial = TRUE}, the default) or is left as \code{NA} because a full window does not exist -(\code{partial = FALSE}), mirroring \code{zoo::rollmean(..., partial = )}. +element \code{i} spans \code{oneSide} elements on either side (window width \code{2 * oneSide + 1}). Near the +edges of \code{x}, the window either shrinks to whatever data is available (\code{partial = TRUE}, +the default) or is left as \code{NA} because a full window does not exist (\code{partial = FALSE}), +mirroring \code{zoo::rollmean(..., partial = )}. } \examples{ movingAve(1:5) diff --git a/man/movingAve2.Rd b/man/movingAve2.Rd index 36b549f..a0f8575 100644 --- a/man/movingAve2.Rd +++ b/man/movingAve2.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CodeAndRoll2.R \name{movingAve2} \alias{movingAve2} -\title{Moving / rolling average (v2, filter) [Deprecated]} +\title{Moving / rolling average (v2, filter) \link{Deprecated}} \usage{ movingAve2(x, n = 5) } From 3b1a10cfe4306669157739e329d5f3695bdfdeef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:34:15 +0000 Subject: [PATCH 2/2] Fix generated .Rd titles for deprecated functions Co-authored-by: vertesy <5101911+vertesy@users.noreply.github.com> --- man/imovingSEM.Rd | 2 +- man/movingAve2.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/imovingSEM.Rd b/man/imovingSEM.Rd index 3fba690..2523065 100644 --- a/man/imovingSEM.Rd +++ b/man/imovingSEM.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CodeAndRoll2.R \name{imovingSEM} \alias{imovingSEM} -\title{imovingSEM \link{Deprecated}} +\title{imovingSEM (Deprecated)} \usage{ imovingSEM(x, oneSide = 5) } diff --git a/man/movingAve2.Rd b/man/movingAve2.Rd index a0f8575..76200c9 100644 --- a/man/movingAve2.Rd +++ b/man/movingAve2.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CodeAndRoll2.R \name{movingAve2} \alias{movingAve2} -\title{Moving / rolling average (v2, filter) \link{Deprecated}} +\title{Moving / rolling average (v2, filter) (Deprecated)} \usage{ movingAve2(x, n = 5) }