count_dyads: Count attribute combinations of dyads in ego-centered...

View source: R/count_dyads.R

count_dyadsR Documentation

Count attribute combinations of dyads in ego-centered networks

Description

count_dyads() counts the attribute combinations of alter-alter ties/ dyads in ego-centered networks. The results can be returned as a wide or long tibble/ data.frame.

Usage

count_dyads(
  object,
  alter_var_name,
  return_as = c("wide", "long"),
  prefix = NULL
)

Arguments

object

An egor object.

alter_var_name

Character, naming the alter variable to use as attribute.

return_as

Character, either "wide" (default) or "long".

prefix

Character, added in front of variables. Only used if return_as is "wide". If NULL (default) prefix is automatically generated.

Value

Wide or long tibble/ data.frame.

Examples

data(egor32)
count_dyads(object = egor32,
            alter_var_name = "country")

# Return result as long tibble.
count_dyads(object = egor32,
            alter_var_name = "country",
            return_as = "long")

egor documentation built on March 31, 2023, 11:33 p.m.