get_names {hwig} | R Documentation |
Get HWI/HWIG names
Description
Helper function, to return names of each matrix
Usage
get_names(DT, by)
Arguments
DT |
input group membership data, in individual/group format |
by |
column(s) to split calculation by. e.g.: year |
Value
names corresponding to values of by for each of the returned list of matrices in calc_hwi and calc_hwig.
See Also
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')
# Calculate HWIG
hwig <- calc_hwig(hwi)
# Set names
nms <- get_names(DT, 'yr')
names(hwig) <- nms
[Package hwig version 0.0.2 Index]