From 512ab612ad58b86055196a318fa930ca4f48fb38 Mon Sep 17 00:00:00 2001 From: "Alec L. Robitaille" Date: Tue, 8 Oct 2024 11:25:43 -0300 Subject: [PATCH] fix .SD --- R/direction_polarization.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/direction_polarization.R b/R/direction_polarization.R index 37dba845..1b03210c 100644 --- a/R/direction_polarization.R +++ b/R/direction_polarization.R @@ -112,7 +112,7 @@ direction_polarization <- function( stop('units(DT$direction) is not radians, did you use direction_step?') } - DT[, c(out) := CircStats::r.test(units::drop_units(.SD))$r.bar, + DT[, c(out) := CircStats::r.test(units::drop_units(.SD[[1]]), degree = FALSE)$r.bar, by = c(group), .SDcols = c(direction)]