R/groupSizes.R

Defines functions groupSizes

Documented in groupSizes

#' @title Group Sizes
#'
#' @description 
#' Extract the group size information from 
#' an Rdistance model frame.
#' 
#' @inheritParams startLimits
#' 
#' @param ... Ignored
#' 
#' @return A vector containing group sizes contained
#' in the Rdistance model frame or fitted object.
#' 
#' @examples
#' 
#' data("sparrowDf")
#' sparrowModel <- parseModel( sparrowDf, dist ~ observer )
#' stats::model.offset(sparrowModel$mf)
#' groupSizes(sparrowModel)  # same, but future-proof
#'
#' sparrowModel <- parseModel( sparrowDf
#'                  , dist ~ observer + groupsize(groupsize) )
#' groupSizes(sparrowModel)  
#' 
#' @export
#' 
groupSizes <- function(ml, ...){
  stats::model.offset(ml$mf)
}

Try the Rdistance package in your browser

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

Rdistance documentation built on Feb. 11, 2026, 9:07 a.m.