From 71de71c52271613745acb49e54477ac872c1f535 Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Sat, 24 Feb 2024 10:00:28 -0800 Subject: [PATCH] fun --- R/collapseHz.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/collapseHz.R b/R/collapseHz.R index 3c8d184f..1d4c45ee 100644 --- a/R/collapseHz.R +++ b/R/collapseHz.R @@ -37,7 +37,7 @@ collapseHz <- function(x, pattern, hzdesgn = guessHzDesgnName(x, required = TRUE g <- unlist(sapply(seq(r$lengths), function(i) rep(i, r$lengths[i]))) res <- h[g %in% unique(g[l]), c(list(hzdeptnew = min(.SD[[hzd[1]]], na.rm = na.rm), hzdepbnew = max(.SD[[hzd[2]]], na.rm = na.rm)), - lapply(.SD, \(x, top, bottom) { + lapply(.SD, function(x, top, bottom) { if (is.numeric(x)) { weighted.mean(x, bottom - top, na.rm = na.rm) } else {