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)]