This function activates one of the data levels of an egor dataset, so that the dplyr verbs know which level to execute on.

# S3 method for egor
activate(.data, what)

Arguments

.data

The egor dataset.

what

Character naming the level to activate, this can be "ego", "alter" or "aatie".

Examples

e <- make_egor(5,50) e %>% activate("aatie") %>% mutate(weight2 = 2 + weight) %>% activate("alter") %>% mutate(age.years = age.years^3)
#> # ALTER data (active): 112 x 7 #> .altID .egoID sex age age.years country income #> <int> <dbl> <chr> <fct> <dbl> <chr> <dbl> #> 1 1 1 m 26 - 35 39304 USA 54750 #> 2 2 1 m 26 - 35 42875 Germany 3650 #> 3 3 1 w 66 - 100 704969 Poland 58400 #> # EGO data: 5 x 6 #> .egoID sex age age.years country income #> <dbl> <chr> <fct> <int> <chr> <dbl> #> 1 1 w 46 - 55 47 Poland 47450 #> 2 2 w 26 - 35 31 USA 69350 #> 3 3 m 66 - 100 68 Germany 20075 #> # AATIE data: 631 x 5 #> .egoID .srcID .tgtID weight weight2 #> <int> <int> <int> <dbl> <dbl> #> 1 5 2 18 0.667 2.67 #> 2 1 1 24 0.667 2.67 #> 3 5 15 19 1 3