comp_ply() applies a function, that uses an alter attribute to calculate
a compositional measurement, on all networks in an egor object and returns a
numeric vector.
Details
When an ego attribute is used the .f is called like this:
.f(alt.attr, ego.attr, ...). .f must return a single numeric value.
Examples
df <- make_egor(10, 32)
comp_ply(df, "age.years", sd, na.rm = TRUE)
#> # A tibble: 10 × 2
#> .egoID result
#> <dbl> <dbl>
#> 1 1 33.8
#> 2 2 30.8
#> 3 3 30.8
#> 4 4 30.8
#> 5 5 31.7
#> 6 6 30.2
#> 7 7 30.3
#> 8 8 31.1
#> 9 9 30.6
#> 10 10 30.4