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.

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 undirected.

Value

returns a vector of network density values.

Examples

data("egor32") ego_density(egor32)
#> [1] 0.5000000 0.4853801 0.5500000 0.4485294 0.4666667 0.3750000 0.4909091 #> [8] 0.4632353 0.4166667 0.4545455 0.4444444 0.4615385 0.5670996 0.4761905 #> [15] 0.5166667 0.6000000 0.4822134 0.5543478 0.6666667 0.4888889 0.5294118 #> [22] 0.5105263 0.4761905 0.5636364 0.4545455 0.5555556 0.5000000 0.4684211 #> [29] 0.5578947 0.6000000 0.5090909 0.4761905