R/group.vm.R

Defines functions group.vm

Documented in group.vm

group.vm <- function(group, fi, rads = FALSE) {
  group <- as.matrix(group)
  if ( !rads )   group <- group / 180 * pi
  u <- Rfast::rowmeans(group) ## mid points of the classes
  u <- rep(u, fi)
  mod <- Directional::circ.summary(u, rads = TRUE, plot = FALSE)
  h <- mean( apply(group, 1, diff) ) ## mean range of the classes
  ah <-  0.5 * h / sin( 0.5 * h )
  mod$MRL <- ah * mod$MRL ## grouped data correction of the MRL
  mod
}

Try the Directional package in your browser

Any scripts or data that you put into this service are public.

Directional documentation built on Oct. 12, 2023, 1:07 a.m.