Created
August 6, 2024 05:04
-
-
Save tilltnet/2226c7003b1472d35fab236255814b98 to your computer and use it in GitHub Desktop.
Filter alter-alter ties before density calculatio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "Filter alter-alter ties" | |
| format: html | |
| --- | |
| Create a minimal `egor` object as an example. | |
| ```{r} | |
| library(egor) | |
| alters <- tibble( | |
| egoID = rep(1:5, 3), | |
| alterID = rep(1:3, 5) | |
| ) | |
| egos <- tibble(egoID = 1:5) | |
| aaties <- tibble( | |
| egoID = sample(1:5, 30, replace = TRUE), | |
| Source = sample(1:3, 30, replace = TRUE), | |
| Target = sample(1:3, 30, replace = TRUE), | |
| weight_chr = sample(c("yes", "no"), 30, replace = TRUE) | |
| ) | |
| e <- egor(alters, egos, aaties) | |
| ``` | |
| ```{r} | |
| e <- | |
| e |> | |
| activate(aatie) |> | |
| filter(weight_char == "yes") |> | |
| activate(ego) | |
| ego_density(e) | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment