composition function

Calculate the composition of alter attributes in an egor object

Calculate the composition of alter attributes in an egor object

composition() calculates the proportional or absolute composition of alters for a given attribute/variable.

composition(object, alt.attr, absolute = FALSE)

Arguments

  • object: An egor object.
  • alt.attr: A character naming the variable containing the alter-attribute.
  • absolute: Logical indicating if the results should be absolute.

Returns

A tibble with the ego ID and values per category of alt.attr as numeric columns.

Examples

data("egor32") composition(egor32, "sex")