Skip to contents

This function uses an egor object and calculates the density of all the ego-centered networks listed in the 'egor' object. Instead of an egor object, alter and alter-alter data can be provided as lists or data.frames.

Usage

ego_density(object, ...)

# S3 method for egor
ego_density(object, weight = NULL, max.netsize = NULL, directed = FALSE, ...)

Arguments

object

An egor object.

...

arguments to be passed to methods

weight

Character naming a variable containing the weight values of relations. Weights should range from 0 to 1.

max.netsize

Optional parameter. Constant value used if the number of alters whose relations were collected is limited.

directed

logical indicating if the alter-alter relation data/ edges are directed or un-directed.

Value

returns a vector of network density values.

Examples

data("egor32")
ego_density(egor32)
#> # A tibble: 32 × 2
#>    .egoID density
#>     <dbl>   <dbl>
#>  1      1   0.485
#>  2      2   0.5  
#>  3      3   0.5  
#>  4      4   0.409
#>  5      5   0.561
#>  6      6   0.455
#>  7      7   0.652
#>  8      8   0.485
#>  9      9   0.515
#> 10     10   0.515
#> # ℹ 22 more rows