From 75f5a3f2d258b8302fd24f763927e351a973b13d Mon Sep 17 00:00:00 2001 From: "Win Cowger, PhD" Date: Wed, 7 Aug 2024 08:40:38 -0700 Subject: [PATCH] add ... and remove na.rm requirement. --- R/def_features.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/def_features.R b/R/def_features.R index 250a78d3..5360ab00 100644 --- a/R/def_features.R +++ b/R/def_features.R @@ -91,7 +91,7 @@ collapse_spec.OpenSpecy <- function(x, fun = median, column = "feature_id", ...) # Calculate the collapsed spectra for each unique feature_id ts <- transpose(x$spectra) ts$id <- x$metadata[[column]] - x$spectra <- ts[, lapply(.SD, fun, na.rm = T), by = "id"] |> + x$spectra <- ts[, lapply(.SD, fun, ...), by = "id"] |> transpose(make.names = "id")