Clean the Data

clean_data <- function(df) {
  df %>%
    rename(
      year = voyage_dates__imp_arrival_at_port_of_dis_sparsedate__year,
      slaves_embarked = voyage_slaves_numbers__imp_total_num_slaves_embarked,
      slaves_disembarked = voyage_slaves_numbers__imp_total_num_slaves_disembarked,
      dis_broad = voyage_itinerary__imp_broad_region_slave_dis__name,
      dis_port = voyage_itinerary__imp_principal_port_slave_dis__name,
      dis_region = voyage_itinerary__imp_principal_region_slave_dis__name,
      outcome = voyage_outcome__particular_outcome__name,
      country = voyage_ship__imputed_nationality__name
    ) %>%
    mutate(
      year = as.integer(year),
      slaves_embarked = as.numeric(slaves_embarked),
      slaves_disembarked = as.numeric(slaves_disembarked)
    ) %>%
    filter(
      !is.na(slaves_disembarked),
      slaves_disembarked > 0,
      outcome %in% c("Voyage completed as intended", "Sold slaves in Americas - subsequent fate unknown")
    ) %>%
    mutate(
      decade = floor(year / 10) * 10,
      estimated_deaths = slaves_embarked - slaves_disembarked,
      is_us = dis_broad == "Mainland North America" |
        dis_port %in% c("New Orleans", "Charleston", "Savannah", "Baltimore", "Mobile", "Philadelphia", "Boston")
    ) %>%
    { print(paste("Remaining rows:", nrow(.))); . }
}

trans_clean <- clean_data(trans)
## [1] "Remaining rows: 23519"
intra_clean <- clean_data(intra)
## [1] "Remaining rows: 33256"
nrow(trans_clean)
## [1] 23519
nrow(intra_clean)
## [1] 33256
trans_clean <- trans_clean %>% mutate(source_type = "Trans-Atlantic")
intra_clean <- intra_clean %>% mutate(source_type = "Intra-American")

combined <- bind_rows(trans_clean, intra_clean)

Total Slaves Imported to the US

us_total <- combined %>%
  filter(is_us) %>%
  summarise(total_slaves_to_us = sum(slaves_disembarked, na.rm = TRUE))

print(us_total)
## # A tibble: 1 × 1
##   total_slaves_to_us
##                <dbl>
## 1             388405

Proportion of All Slaves Taken from Africa who went to the US

africa_total <- trans_clean %>%
  summarise(total_embarked = sum(slaves_embarked, na.rm = TRUE))

proportion_to_us <- us_total$total_slaves_to_us / africa_total$total_embarked

print(proportion_to_us)
## [1] 0.0526458

Graph - Slave Imports to US by Decade

combined %>%
  filter(is_us) %>%
  group_by(decade) %>%
  summarise(total_disembarked = sum(slaves_disembarked, na.rm = TRUE)) %>%
  mutate(decade = factor(decade, levels = sort(unique(decade)))) %>%
  ggplot(aes(x = decade, y = total_disembarked)) +
  geom_bar(stat = "identity", fill = "gray40") +
  labs(title = "Slaves Imported to the US by Decade", x = "Decade", y = "Number of Slaves") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Table + Faceted Plot - US imports by Decade & State

library(ggplot2)
library(dplyr)
library(stringr)
library(scales)
## 
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
## 
##     discard
## The following object is masked from 'package:readr':
## 
##     col_factor
combined %>%
  filter(is_us) %>%
  mutate(
    state = case_when(
      str_detect(dis_port, "New Orleans") ~ "Louisiana",
      str_detect(dis_port, "Charleston") ~ "South Carolina",
      str_detect(dis_port, "Savannah") ~ "Georgia",
      str_detect(dis_port, "Baltimore") ~ "Maryland",
      str_detect(dis_port, "Mobile") ~ "Alabama",
      str_detect(dis_port, "Philadelphia") ~ "Pennsylvania",
      str_detect(dis_port, "Boston") ~ "Massachusetts",
      TRUE ~ "Other"
    ),
    decade = floor(year / 20) * 20,
    decade = factor(decade, levels = sort(unique(floor(year / 20) * 20)))
  ) %>%
  group_by(decade, state) %>%
  summarise(
    total_disembarked = sum(slaves_disembarked, na.rm = TRUE),
    .groups = "drop"
  ) %>%
  ggplot(aes(x = decade, y = total_disembarked, fill = state)) +
  geom_bar(stat = "identity") +
  facet_wrap(~ state, scales = "free_y") +
  labs(
    title = "US Slave Imports by Decade and State",
    x = "Decade",
    y = "Number of Slaves"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1, size = 6),
    strip.text = element_text(size = 10)
  ) +
  scale_x_discrete(breaks = scales::pretty_breaks(n = 4))

Summary of Findings

  • A total of 388,405 enslaved individuals were disembarked in the United States across both Trans-Atlantic and Intra-American slave trades.

  • This represents approximately 5.26% of all Africans forcibly taken from Africa in the Trans-Atlantic slave trade.

  • The peak decades for US slave imports were in the late 1700s through the early 1800s.

  • The primary US ports for disembarkation were New Orleans, Charleston, and Savannah, with smaller numbers in Massachusetts, Pennsylvania, and other colonies/states.