MyNixOS website logo
Description

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) <doi:10.1016/j.anbehav.2012.12.010>.

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.

Metadata

Version

0.0.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows