Data Visualization for IR
Introduction
Why Visualize?
About this Book
Prerequisites
Acknowledgements
Contact
1
Principles of Data Visualization
1.1
Data Ethics
1.1.1
Include the Baseline
1.1.2
Consider the Audience
1.1.3
Avoid Cherry-picking
1.2
Inclusive Colors
1.3
Less is more
2
The Grammar of Graphics
2.1
The
tidyverse
Package
2.2
The
ggplot2
Package
2.3
Example
2.4
Choosing the Right Plot
3
Data Wrangling
3.1
Tidy Data
3.2
WDI Example
3.2.1
Wide to long format
3.2.2
Reshaping with
gather()
3.2.3
Reshaping with
melt()
3.2.4
Transforming Variables with
mutate()
3.2.5
Merging data sets with
left_join
3.3
Text cleaning with
stringr
3.3.1
General cleaning
3.3.2
Matching
3.3.3
Mutating Strings
3.3.4
Building a data set
4
R Markdown Reports
4.0.1
Basic Syntax
4.0.2
Chunks
4.0.3
Display Options
4.0.4
Tables
4.1
Example with
mtcars
(yes,
again
…)
4.2
Troubleshooting
5
Basic Webscraping
5.1
The
rvest
package
5.1.1
Define the URL
5.1.2
Read the URL
5.1.3
Ploting
5.2
Cleaning Text
5.3
A
for
Loop
5.4
Functions
5.5
Writing our
corpus
6
Text as Data
6.1
Our Scraped Corpus
7
Choropleth Maps
7.1
World Maps
7.2
Country Maps
7.3
Scraping and Maping
7.4
Challenge
References
Published with bookdown
Data Visualization for International Relations
References