calc_hwi: Calculate HWI

View source: R/hwig.R

calc_hwiR Documentation

Calculate HWI

Description

Calculates the Half-Weight Association Index

Usage

calc_hwi(DT, id, group, by = NULL)

Arguments

DT

input group membership data, in individual/group format

id

column indicating id in DT

group

column indicating group in DT

by

column(s) to split calculation by. e.g.: year

Details

Expects an input 'DT' with id and group column, e.g. as returned by group_pts.

Value

HWI data.table or list of data.tables.

See Also

calc_hwig

Examples

# Load data.table
library(data.table)

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

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

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