From 527efa1ca938d7a0a8ef45ec50bc4762ed1450f4 Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Mon, 20 Jan 2025 18:09:31 -0500 Subject: [PATCH] Fixed `as_function` bug; fixed typo --- .gitignore | 2 ++ DESCRIPTION | 2 +- NAMESPACE | 1 + R/rollup.R | 8 ++++---- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f8d4dbb..44bdd93 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ Misc/ **/*.html vignettes/*.R + +tests/ diff --git a/DESCRIPTION b/DESCRIPTION index f51eed1..c19747c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -90,4 +90,4 @@ Remotes: github::cran/FField, github::PNNL-Comp-Mass-Spec/MSnID@pnnl-master VignetteBuilder: knitr -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 diff --git a/NAMESPACE b/NAMESPACE index 1c3947d..4d15ab9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -249,6 +249,7 @@ importFrom(reshape2,acast) importFrom(reshape2,melt) importFrom(rlang,"!!") importFrom(rlang,":=") +importFrom(rlang,as_function) importFrom(rlang,parse_expr) importFrom(rlang,sym) importFrom(scales,alpha) diff --git a/R/rollup.R b/R/rollup.R index 8be0257..045f72c 100644 --- a/R/rollup.R +++ b/R/rollup.R @@ -36,16 +36,16 @@ rrollup <- function(msnset, rollBy, rollFun, algorithm <- match.arg(algorithm) if(algorithm == "reference"){ - summarisedFeatures <- list() + summarizedFeatures <- list() unique_rollBy <- unique(fData(msnset)[[rollBy]]) - for (i in 1:length(unique_rollBy)) { + for (i in seq_along(unique_rollBy)) { # Subset msnset to each rollBy group msnset_sub <- msnset[fData(msnset)[[rollBy]] == unique_rollBy[i], , drop = FALSE] - summarisedFeatures[[i]] <- rrollup_a_feature_set(msnset_sub, rollBy, + summarizedFeatures[[i]] <- rrollup_a_feature_set(msnset_sub, rollBy, rollFun, verbose) } - exprs.new <- do.call(rbind, summarisedFeatures) + exprs.new <- do.call(rbind, summarizedFeatures) rownames(exprs.new) <- unique_rollBy } else { temp <- data.frame(rollBy = fData(msnset)[[rollBy]],