African-American History
Network diagram, Wordcloud
Notable topics: Network diagram, Wordcloud
Recorded on: 2020-06-15
Timestamps by: Eric Fletcher
Screencast
Timestamps
Use fct_lump
from the forcats
package to lump together all the factor levels in ship_name
except the n
most frequent. Used within filter
with ! = "Other"
to remove other
.
use fct_reorder
from the forcats
package to reorder the ship_name
factor levels y sorting along the n_slaves_arrived
variable.
Add geom_vline
to geom_histogram
to annotate the plot with a vertical line indicating the Revolutionary War and the Civil War.
Use truncated division
within count
to create a new decade
variable equal to 10 * (year_arrival %/% 10))
Use str_trunc
from the stringr
package to truncate the titles in each facet panel accounting for the slave ports with really long names.
Another option for accounting for long titles in the facet panels is to use strip.text
within theme
with element_text(size = 6)
Use the ggraph
package to create a network diagram
using port_origin
and port_arrival
.
Use arrow
from the grid
package to add directional arrows to the points in the network diagram
.
Use scale_width_size_continuous
from the ggraph
packge to adjust the size of the points in the network diagram
.
Within summarize
use mean(n_slaves_arrived, na.rm = TRUE) * n())
to come up with an estimated total numer of slaves since 49% of the data is missing.
Create a faceted stacked percent barplot (spinogram) showing the percentage of black_free
, black_slaves
, white
, and other
for each region.
Use the wordcloud
package to create a wordcloud
with the african_names
dataset. David hsa issues with the wordcloud
package and opts to use ggwordcloud
instead. Also, mentions the worldcloud2
package.
Use fct_recode
from the forcats
package to change the factor levels for the gender
variable while renaming Man = "Boy"
and Woman = "Girl"
Use reorder_within
from the tidytext
package to reorder the geom_col
by n
within gender
variable for each facet panel.
Summary of screencast.