powered by
Calculates the Half-Weight Association Index
calc_hwi(DT, id, group, by = NULL)
input group membership data, in individual/group format
column indicating id in DT
column indicating group in DT
column(s) to split calculation by. e.g.: year
HWI data.table or list of data.tables.
Expects an input `DT` with id and group column, e.g. as returned by group_pts.
calc_hwig
# NOT RUN { # 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') # }
Run the code above in your browser using DataLab