Half-Weight Index Gregariousness

The half-weight index gregariousness (HWIG) is an association index used in social network analyses. It extends the half-weight association index (HWI), correcting for level of gregariousness in individuals. It is calculated using group by individual data according to methods described in Godde et al. (2013) .


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')
#> Generating  10  x  10  matrix
#> Generating  10  x  10  matrix

# Calculate HWIG
hwig <- calc_hwig(hwi)

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

# Print first year's result
hwig[1]
#> $`2016`
#>       A     B      C D      E      F     G      H      I     J
#>  0.0000 0.000 1.0006 0 0.6857 1.3337 0.000 0.2727 1.5114 1.000
#>  0.0000 0.000 0.0000 0 0.0000 0.0000 3.058 0.0000 0.0000 0.000
#>  1.0006 0.000 0.0000 0 0.0000 1.1153 0.000 0.8868 1.3630 0.000
#>  0.0000 0.000 0.0000 0 0.0000 0.0000 0.000 0.0000 0.0000 0.000
#>  0.6857 0.000 0.0000 0 0.0000 0.5944 0.000 2.2281 0.4953 0.000
#>  1.3337 0.000 1.1153 0 0.5944 0.0000 0.000 0.4728 0.6936 0.000
#>  0.0000 3.058 0.0000 0 0.0000 0.0000 0.000 0.0000 0.0000 0.000
#>  0.2727 0.000 0.8868 0 2.2281 0.4728 0.000 0.0000 0.6303 1.773
#>  1.5114 0.000 1.3630 0 0.4953 0.6936 0.000 0.6303 0.0000 0.867
#>  1.0001 0.000 0.0000 0 0.0000 0.0000 0.000 1.7727 0.8670 0.000

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.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("hwig")

0.0.2 by Alec L. Robitaille, 5 years ago


https://gitlab.com/robit.a/hwig, https://github.com/robitalec/hwig


Report a bug at https://github.com/robitalec/hwig/issues


Browse source code at https://github.com/cran/hwig


Authors: Alec L. Robitaille [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports asnipe, spatsoc, data.table

Suggests testthat


See at CRAN