File tree Expand file tree Collapse file tree 2 files changed +21
-17
lines changed Expand file tree Collapse file tree 2 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ use in a tidy workflow.
32
32
``` {r, message=FALSE}
33
33
library(tidygraph)
34
34
35
- play_erdos_renyi (10, 0.5) %>%
35
+ play_gnp (10, 0.5) %>%
36
36
activate(nodes) %>%
37
37
mutate(degree = centrality_degree()) %>%
38
38
activate(edges) %>%
Original file line number Diff line number Diff line change @@ -25,33 +25,37 @@ workflow.
25
25
``` r
26
26
library(tidygraph )
27
27
28
- play_erdos_renyi (10 , 0.5 ) %> %
28
+ play_gnp (10 , 0.5 ) %> %
29
29
activate(nodes ) %> %
30
30
mutate(degree = centrality_degree()) %> %
31
31
activate(edges ) %> %
32
32
mutate(centrality = centrality_edge_betweenness()) %> %
33
33
arrange(centrality )
34
- # > # A tbl_graph: 10 nodes and 57 edges
34
+ # > # A tbl_graph: 10 nodes and 47 edges
35
35
# > #
36
36
# > # A directed simple graph with 1 component
37
37
# > #
38
- # > # A tibble: 57 × 3
39
- # > from to centrality
40
- # > <int> <int> <dbl>
41
- # > 1 4 3 1.31
42
- # > 2 6 3 1.33
43
- # > 3 8 5 1.33
44
- # > 4 8 2 1.34
45
- # > 5 9 2 1.34
46
- # > 6 7 3 1.37
47
- # > # ℹ 51 more rows
38
+ # > # Edge Data: 47 × 3 (active)
39
+ # > from to centrality
40
+ # > <int> <int> <dbl>
41
+ # > 1 5 8 1
42
+ # > 2 3 6 1.2
43
+ # > 3 5 9 1.2
44
+ # > 4 10 1 1.25
45
+ # > 5 3 8 1.25
46
+ # > 6 4 1 1.33
47
+ # > 7 5 1 1.33
48
+ # > 8 5 6 1.33
49
+ # > 9 5 10 1.5
50
+ # > 10 6 8 1.5
51
+ # > # ℹ 37 more rows
48
52
# > #
49
- # > # A tibble : 10 × 1
53
+ # > # Node Data : 10 × 1
50
54
# > degree
51
55
# > <dbl>
52
- # > 1 5
53
- # > 2 4
54
- # > 3 6
56
+ # > 1 4
57
+ # > 2 5
58
+ # > 3 7
55
59
# > # ℹ 7 more rows
56
60
```
57
61
You can’t perform that action at this time.
0 commit comments