powered by
egor
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.
comp_ply()
numeric vector
comp_ply(object, alt.attr, .f, ..., ego.attr = NULL, result.name = "result")
A tibble with the ego ID and a numeric result vector.
tibble
numeric
An egor object.
A character naming the variable containing the alter-attribute.
character
A function that returns a numeric.
function
Optional arguments to .f.
.f
Optional character naming an ego attribute.
Optional character naming the result column.
Michał Bojanowski, michal2992@gmail.com
Till Krenz, egor@tillt.net
When an ego attribute is used the .f is called like this: .f(alt.attr, ego.attr, ...). .f must return a single numeric value.
.f(alt.attr, ego.attr, ...)
df <- make_egor(10, 32) comp_ply(df, "age.years", sd, na.rm = TRUE)
Run the code above in your browser using DataLab