Skip to content

Commit ff8f30b

Browse files
committed
minor changes
1 parent ebcf080 commit ff8f30b

7 files changed

+40
-14
lines changed

intro_networks.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ knitr::include_graphics('images/example.png')
124124
- "Traditional modeling approaches in this realm have treated **workers as narrowly linked to specific jobs**.
125125
- "In the real world, however, **jobs and sectors are linked**. <span style="color:red">Displaced workers can often transition to another job or sector requiring similar skills.</span>"
126126
- "In this way, **job markets are much like ecosystems, where organisms are linked in a complex web of relationships**.
127-
- "The authors modeled the relationships between jobs in cities across the United States. They predicted that **cities with jobs connected by overlapping skills** and geography would fare better in the face of economic shock than those without such networks."
127+
- "The authors modeled the relationships between jobs in cities across the United States. They predicted that **cities with jobs connected by overlapping skills and geography** would fare better in the face of economic shock than those without such networks."
128128
- "They found that while cities of similar sizes would be affected similarly in the beginning phases of automation shocks, those with **well-connected job networks** would provide **better opportunities** for displaced workers to find other jobs."
129129
- "This provides a buffer against widespread unemployment, and in some cases even leads to **more jobs** being created in the aftermath of the initial automation shock."
130130
- A city like Burlington, Vermont, where job connectivity is high, would fare much better than Bloomington, Indiana, a similar-sized city where job connectivity is low.

intro_networks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
- "Traditional modeling approaches in this realm have treated **workers as narrowly linked to specific jobs**.
116116
- "In the real world, however, **jobs and sectors are linked**. &lt;span style="color:red"&gt;Displaced workers can often transition to another job or sector requiring similar skills.&lt;/span&gt;"
117117
- "In this way, **job markets are much like ecosystems, where organisms are linked in a complex web of relationships**.
118-
- "The authors modeled the relationships between jobs in cities across the United States. They predicted that **cities with jobs connected by overlapping skills** and geography would fare better in the face of economic shock than those without such networks."
118+
- "The authors modeled the relationships between jobs in cities across the United States. They predicted that **cities with jobs connected by overlapping skills and geography** would fare better in the face of economic shock than those without such networks."
119119
- "They found that while cities of similar sizes would be affected similarly in the beginning phases of automation shocks, those with **well-connected job networks** would provide **better opportunities** for displaced workers to find other jobs."
120120
- "This provides a buffer against widespread unemployment, and in some cases even leads to **more jobs** being created in the aftermath of the initial automation shock."
121121
- A city like Burlington, Vermont, where job connectivity is high, would fare much better than Bloomington, Indiana, a similar-sized city where job connectivity is low.

intro_tidygraph_ggraph.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,8 @@ trader_1 <- bitcoin_tbl_graph %>%
499499

500500
```{r}
501501
trader_1 %>%
502-
activate(nodes) %>%
503502
as_tibble() %>%
504-
View()
503+
View()
505504
```
506505

507506
---

intro_tidygraph_ggraph.html

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@
614614
#sort the nodes by their degree (in descending form)
615615
node_degree &lt;- bitcoin_tbl_graph %&gt;%
616616
activate(nodes) %&gt;%
617-
mutate(degree = centrality_degree()) %&gt;%
618-
as_tibble() %&gt;%
617+
mutate(degree = centrality_degree()) %&gt;% #returns degree column in an active node table
618+
as_tibble() %&gt;% #get node table
619619
arrange(-degree)
620620

621621
#View(node_degree)
@@ -632,22 +632,49 @@
632632
activate(edges) %&gt;%
633633
filter(weight == 1) %&gt;% #find who gets 1
634634
as_tibble() %&gt;%
635-
count(to) %&gt;% #count how many 1's received that person
636-
View()
635+
count(to) #%&gt;% #count how many 1's received that person
636+
#View()
637637
```
638638

639639
---
640-
- If we want to filter just edges from ID 34, we can use the `filter()` function from `dplyr` and create a new graph object with `as_tbl_graph()`:
640+
- If we want to filter just edges from ID 1, we can use the `filter()` function from `dplyr` and create a new graph object with `as_tbl_graph()`:
641641

642642

643643
```r
644-
trader_34 &lt;- bitcoin_tbl_graph %&gt;%
644+
trader_1 &lt;- bitcoin_tbl_graph %&gt;%
645645
activate(edges) %&gt;%
646-
filter(from == 34) %&gt;%
646+
filter(from == 1) %&gt;%
647647
as_tbl_graph()
648648
#View(trader_34)
649649
```
650650

651+
652+
```r
653+
trader_1 %&gt;%
654+
as_tibble() #%&gt;%
655+
```
656+
657+
```
658+
#&gt; # A tibble: 195 × 3
659+
#&gt; from to weight
660+
#&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt;
661+
#&gt; 1 1 41 0.1
662+
#&gt; 2 1 12 0.1
663+
#&gt; 3 1 6 0.9
664+
#&gt; 4 1 11 0.2
665+
#&gt; 5 1 2 0.3
666+
#&gt; 6 1 26 0.2
667+
#&gt; 7 1 31 0.1
668+
#&gt; 8 1 29 0.2
669+
#&gt; 9 1 45 0.1
670+
#&gt; 10 1 20 0.6
671+
#&gt; # … with 185 more rows
672+
```
673+
674+
```r
675+
#View()
676+
```
677+
651678
---
652679
- Calculate the centrality of betwenness in the bitcoin network.
653680

@@ -734,7 +761,7 @@
734761
]
735762

736763
.panel[.panel-name[Output]
737-
![](intro_tidygraph_ggraph_files/figure-html/unnamed-chunk-39-1.png)&lt;!-- --&gt;
764+
![](intro_tidygraph_ggraph_files/figure-html/unnamed-chunk-40-1.png)&lt;!-- --&gt;
738765
]
739766
]
740767

@@ -769,7 +796,7 @@
769796
]
770797

771798
.panel[.panel-name[Output]
772-
![](intro_tidygraph_ggraph_files/figure-html/unnamed-chunk-41-1.png)&lt;!-- --&gt;
799+
![](intro_tidygraph_ggraph_files/figure-html/unnamed-chunk-42-1.png)&lt;!-- --&gt;
773800
]
774801
]
775802

@@ -796,7 +823,7 @@
796823
]
797824

798825
.panel[.panel-name[Output]
799-
![](intro_tidygraph_ggraph_files/figure-html/unnamed-chunk-43-1.png)&lt;!-- --&gt;
826+
![](intro_tidygraph_ggraph_files/figure-html/unnamed-chunk-44-1.png)&lt;!-- --&gt;
800827

801828
]
802829
]
Loading
Loading
Loading

0 commit comments

Comments
 (0)