knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  eval = FALSE
)

options(datatable.print.rownames = FALSE, 
        datatable.print.class = FALSE)

hwig

Calculates the half-weight index gregariousness (HWIG) as described in Godde et al. (2013) [1].

Installation

devtools::install_gitlab('robit.a/hwig')

# CRAN
install.packages('hwig')

Usage

# Load packages
library(hwig)
library(data.table)

# Load example data
DT <- fread(system.file("extdata", "DT.csv", package = "hwig"))

# Calculate HWI
hwi <- calc_hwi(DT, 'id', 'group', 'yr')

# Calculate HWIG
hwig <- calc_hwig(hwi)

# Set names
nms <- get_names(DT, 'yr')
names(hwig) <- nms

# Print first year's result
hwig[1]

References

[1] Sophie Godde, Lionel Humbert, Steeve D. Côté, Denis Réale, Hal Whitehead. Correcting for the impact of gregariousness in social network analyses. Animal Behaviour. Volume 85, Issue 3. 2013.



robitalec/hwig documentation built on March 5, 2023, 10:24 a.m.