# Load required library
library(tidyverse)


col_types_spec <- cols_only(
  id = col_integer(),
  voyage_id = col_integer(),
  voyage_dates__imp_arrival_at_port_of_dis_sparsedate__year = col_double(),
  voyage_slaves_numbers__imp_total_num_slaves_disembarked = col_double(),
  voyage_slaves_numbers__imp_total_num_slaves_embarked = col_double(),
  voyage_dates__length_middle_passage_days = col_double(),
  voyage_dates__imp_length_home_to_disembark = col_double(),
  voyage_crew__crew_first_landing = col_double(),
  voyage_crew__crew_voyage_outset = col_double(),
  voyage_ship__tonnage_mod = col_double(),
  voyage_slaves_numbers__imp_jamaican_cash_price = col_double(),
  voyage_slaves_numbers__imp_mortality_ratio = col_double(),
  voyage_slaves_numbers__percentage_women_among_embarked_slaves = col_double(),
  voyage_outcome__vessel_captured_outcome__name = col_character(),
  voyage_ship__imputed_nationality__name = col_character(),
  voyage_itinerary__imp_region_voyage_begin__name = col_character(),
  voyage_ship__rig_of_vessel__name = col_character(),
  voyage_itinerary__place_voyage_ended__name = col_character(),  # Force as character
  voyage_dates__slave_purchase_began_sparsedate__month = col_double(),
  voyage_slaves_numbers__percentage_men = col_double(),
  voyage_dates__voyage_completed_sparsedate__month = col_double(),
  voyage_itinerary__region_of_return__name = col_character(),
  voyage_slaves_numbers__percentage_boy = col_double(),
  voyage_itinerary__imp_principal_region_slave_dis__name = col_character(),
  voyage_itinerary__imp_principal_region_of_slave_purchase__name = col_character(),
  voyage_dates__date_departed_africa_sparsedate__month = col_double(),
  voyage_dates__voyage_began_sparsedate__month = col_double(),
  voyage_itinerary__imp_port_voyage_begin__name = col_character(),
  voyage_dates__first_dis_of_slaves_sparsedate__month = col_double(),
  voyage_itinerary__imp_broad_region_slave_dis__name = col_character(),
  voyage_slaves_numbers__percentage_girl = col_double(),
  voyage_outcome__particular_outcome__name = col_character(),
  voyage_itinerary__imp_principal_port_slave_dis__name = col_character(),
  voyage_slaves_numbers__percentage_child = col_double(),
  voyage_slaves_numbers__percentage_women = col_double(),
  voyage_dates__departure_last_place_of_landing_sparsedate__month = col_double(),
  voyage_outcome__outcome_owner__name = col_character(),
  voyage_outcome__outcome_slaves__name = col_character(),
  voyage_itinerary__imp_principal_place_of_slave_purchase__name = col_character(),
  voyage_outcome__resistance__name = col_character(),
  voyage_slaves_numbers__percentage_male = col_double(),
  voyage_slaves_numbers__percentage_female = col_double(),
  voyage_itinerary__imp_broad_region_voyage_begin__name = col_character(),
  voyage_itinerary__imp_broad_region_of_slave_purchase__name = col_character(),
  voyage_sources = col_character(),
  enslavers = col_character()
)


# Load the datasets
trans <- read_csv("https://raw.githubusercontent.com/imowerman-prog/data-3210/refs/heads/main/Data/trans-atlantic.csv", col_types = col_types_spec)
intra <- read_csv("https://raw.githubusercontent.com/imowerman-prog/data-3210/refs/heads/main/Data/intra-american.csv", col_types = col_types_spec)


library(tidyverse)

# --- Rename columns for readability ---
trans_clean <- trans %>%
  rename(
    year = voyage_dates__imp_arrival_at_port_of_dis_sparsedate__year,
    slaves_disembarked = voyage_slaves_numbers__imp_total_num_slaves_disembarked,
    slaves_embarked = voyage_slaves_numbers__imp_total_num_slaves_embarked,
    middle_passage_days = voyage_dates__length_middle_passage_days,
    voyage_length = voyage_dates__imp_length_home_to_disembark,
    crew_first_landing = voyage_crew__crew_first_landing,
    crew_outset = voyage_crew__crew_voyage_outset,
    tonnage = voyage_ship__tonnage_mod,
    cash_price = voyage_slaves_numbers__imp_jamaican_cash_price,
    mortality_ratio = voyage_slaves_numbers__imp_mortality_ratio,
    pct_women_embarked = voyage_slaves_numbers__percentage_women_among_embarked_slaves,
    vessel_captured = voyage_outcome__vessel_captured_outcome__name,
    nationality = voyage_ship__imputed_nationality__name,
    region_begin = voyage_itinerary__imp_region_voyage_begin__name,
    rig = voyage_ship__rig_of_vessel__name,
    place_ended = voyage_itinerary__place_voyage_ended__name,
    outcome = voyage_outcome__outcome_slaves__name,
    dis_broad = voyage_itinerary__imp_broad_region_slave_dis__name,
    dis_principal_region = voyage_itinerary__imp_principal_region_slave_dis__name,
    dis_principal_port = voyage_itinerary__imp_principal_port_slave_dis__name,
    purchase_region = voyage_itinerary__imp_principal_region_of_slave_purchase__name,
    purchase_place = voyage_itinerary__imp_principal_place_of_slave_purchase__name
  )

# Repeat renaming for intra dataset
intra_clean <- intra %>%
  rename(
    year = voyage_dates__imp_arrival_at_port_of_dis_sparsedate__year,
    slaves_disembarked = voyage_slaves_numbers__imp_total_num_slaves_disembarked,
    slaves_embarked = voyage_slaves_numbers__imp_total_num_slaves_embarked,
    middle_passage_days = voyage_dates__length_middle_passage_days,
    voyage_length = voyage_dates__imp_length_home_to_disembark,
    crew_first_landing = voyage_crew__crew_first_landing,
    crew_outset = voyage_crew__crew_voyage_outset,
    tonnage = voyage_ship__tonnage_mod,
    cash_price = voyage_slaves_numbers__imp_jamaican_cash_price,
    mortality_ratio = voyage_slaves_numbers__imp_mortality_ratio,
    pct_women_embarked = voyage_slaves_numbers__percentage_women_among_embarked_slaves,
    vessel_captured = voyage_outcome__vessel_captured_outcome__name,
    nationality = voyage_ship__imputed_nationality__name,
    region_begin = voyage_itinerary__imp_region_voyage_begin__name,
    rig = voyage_ship__rig_of_vessel__name,
    place_ended = voyage_itinerary__place_voyage_ended__name,
    outcome = voyage_outcome__outcome_slaves__name,
    dis_broad = voyage_itinerary__imp_broad_region_slave_dis__name,
    dis_principal_region = voyage_itinerary__imp_principal_region_slave_dis__name,
    dis_principal_port = voyage_itinerary__imp_principal_port_slave_dis__name,
    purchase_region = voyage_itinerary__imp_principal_region_of_slave_purchase__name,
    purchase_place = voyage_itinerary__imp_principal_place_of_slave_purchase__name
  )

# --- Cleaning function ---
clean_data <- function(df, source_name) {
  df %>%
    # Convert year and slave numbers
    mutate(
      year = as.integer(year),
      slaves_embarked = as.numeric(slaves_embarked),
      slaves_disembarked = as.numeric(slaves_disembarked)
    ) %>%
    # Filter out incomplete voyages
    filter(!is.na(slaves_disembarked), slaves_disembarked > 0) %>%
    # Keep successful outcomes
    # filter(outcome %in% c("Slaves disembarked", "Voyage completed", "Sold slaves")) %>%
    # Add new variables
    mutate(
      decade = floor(year / 10) * 10,
      estimated_deaths = slaves_embarked - slaves_disembarked,
      is_us = if_else(
        dis_broad == "Mainland North America" |
          place_ended %in% c("New Orleans", "Charleston", "Savannah", "Norfolk", "Boston", "New York"),
        TRUE, FALSE
      ),
      source_type = source_name
    )
}

# Apply cleaning to both datasets
trans_final <- clean_data(trans_clean, "Trans-Atlantic")
intra_final <- clean_data(intra_clean, "Intra-American")

# Combine datasets
voyages <- bind_rows(trans_final, intra_final)

Analysis

Total Slaves Imported to the US

us_total <- voyages %>%
  filter(is_us == TRUE) %>%
  summarise(total_slaves_disembarked = sum(slaves_disembarked, na.rm = TRUE)) %>%
  pull(total_slaves_disembarked)

cat("Total slaves imported to the US:", format(us_total, big.mark = ","), "\n")
## Total slaves imported to the US: 445,250

Proportion of Slaves Taken from Africa

africa_total <- trans_final %>%
  summarise(total_slaves_embarked = sum(slaves_embarked, na.rm = TRUE)) %>%
  pull(total_slaves_embarked)

proportion_us <- us_total / africa_total
cat("Proportion of slaves taken from Africa to the US:", round(proportion_us, 4), "\n")
## Proportion of slaves taken from Africa to the US: 0.0421

Slave Imports to the US by Decade

us_by_decade <- voyages %>%
  filter(is_us == TRUE) %>%
  group_by(decade) %>%
  summarise(total_slaves_disembarked = sum(slaves_disembarked, na.rm = TRUE), .groups = "drop")

# Bar plot
ggplot(us_by_decade, aes(x = as.factor(decade), y = total_slaves_disembarked)) +
  geom_bar(stat = "identity", fill = "steelblue") +
  labs(
    title = "Slave Imports to the US by Decade",
    x = "Decade",
    y = "Number of Slaves Disembarked"
  ) +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Imports to the US by Decade and Region/Port/State

us_by_decade_region <- voyages %>%
  filter(is_us == TRUE) %>%
  mutate(state = case_when(
    dis_principal_port == "New Orleans" ~ "Louisiana",
    dis_principal_port == "Charleston" ~ "South Carolina",
    dis_principal_port == "Savannah" ~ "Georgia",
    dis_principal_port == "Norfolk" ~ "Virginia",
    dis_principal_port == "Boston" ~ "Massachusetts",
    dis_principal_port == "New York" ~ "New York",
    dis_principal_port == "New-Orleans" ~ "Louisiana",
    dis_principal_port == "Charles Town" ~ "South Carolina",
    dis_principal_port == "Savanna" ~ "Georgia",
    TRUE ~ dis_principal_region
  )) %>%
  group_by(decade, dis_principal_region, dis_principal_port, state) %>%
  summarise(total_slaves_disembarked = sum(slaves_disembarked, na.rm = TRUE), .groups = "drop")

# Display table
us_by_decade_region %>%
  knitr::kable(caption = "Slave Imports to the US by Decade, Region, Port, and State")
Slave Imports to the US by Decade, Region, Port, and State
decade dis_principal_region dis_principal_port state total_slaves_disembarked
1610 Virginia Hampton Virginia 29
1620 Virginia Virginia, port unspecified Virginia 3
1630 Massachusetts Boston Massachusetts 7
1630 New York New York New York 53
1630 Virginia Virginia, port unspecified Virginia 13
1640 Barbados Barbados, place unspecified Barbados 126
1640 New York New York New York 69
1640 Virginia Virginia, port unspecified Virginia 435
1650 Maryland Maryland, port unspecified Maryland 5
1650 New York New York New York 477
1650 Virginia Virginia, port unspecified Virginia 469
1660 Maryland Maryland, port unspecified Maryland 158
1660 Maryland Patuxent Maryland 3
1660 New York New York New York 436
1660 Virginia Virginia, port unspecified Virginia 105
1670 Jamaica Jamaica, place unspecified Jamaica 126
1670 Maryland Patuxent Maryland 5
1670 Massachusetts Boston Massachusetts 45
1670 South Carolina South Carolina, place unspecified South Carolina 4
1670 Virginia Virginia, port unspecified Virginia 1673
1680 Maryland Maryland, port unspecified Maryland 366
1680 New Jersey Perth Amboy New Jersey 114
1680 New York New York New York 107
1680 Other North America USA, location unspecified Other North America 90
1680 South Carolina Charleston South Carolina 6
1680 Virginia Virginia, port unspecified Virginia 1750
1690 Maryland Annapolis Maryland 861
1690 Maryland Cecil County Maryland 218
1690 Maryland Maryland, port unspecified Maryland 1021
1690 Maryland Oxford Maryland 13
1690 Maryland Patuxent Maryland 387
1690 Maryland Pocomoke Maryland 15
1690 Maryland St. Mary’s River Maryland 8
1690 New York New York New York 760
1690 Rhode Island Newport Rhode Island 47
1690 South Carolina Charleston South Carolina 15
1690 Virginia Rappahannock Virginia 6
1690 Virginia South Potomac Virginia 2
1690 Virginia Virginia, port unspecified Virginia 738
1690 Virginia York River Virginia 195
1700 Antigua Saint John (Antigua) Antigua 92
1700 Maryland Cecil County Maryland 14
1700 Maryland Maryland, port unspecified Maryland 2456
1700 Maryland Patuxent Maryland 439
1700 Maryland Pocomoke Maryland 7
1700 Massachusetts Boston Massachusetts 43
1700 New York New York New York 24
1700 North Carolina Roanoke North Carolina 2
1700 Other North America Carolinas Other North America 25
1700 Pennsylvania Pennsylvania, port unspecified Pennsylvania 3
1700 Pennsylvania Philadelphia Pennsylvania 10
1700 South Carolina South Carolina, place unspecified South Carolina 217
1700 Virginia Lower James River Virginia 42
1700 Virginia Potomac river Virginia 16
1700 Virginia Rappahannock Virginia 85
1700 Virginia Upper James River Virginia 57
1700 Virginia Virginia, port unspecified Virginia 5238
1700 Virginia York River Virginia 3041
1710 Barbados Barbados, place unspecified Barbados 128
1710 Gulf coast Louisiana Gulf coast 450
1710 Maine Kittery Point Maine 1
1710 Maryland Annapolis Maryland 117
1710 Maryland Londontowne Maryland 160
1710 Maryland Maryland, port unspecified Maryland 2
1710 Massachusetts Boston Massachusetts 42
1710 New York New York New York 1516
1710 North Carolina North Carolina, port unspecified North Carolina 19
1710 Other North America Carolinas Other North America 28
1710 Pennsylvania Philadelphia Pennsylvania 1
1710 Rhode Island Providence Rhode Island 29
1710 South Carolina Charleston South Carolina 2401
1710 South Carolina South Carolina, place unspecified South Carolina 338
1710 Virginia Hampton Virginia 2
1710 Virginia Lower James River Virginia 869
1710 Virginia Potomac river Virginia 61
1710 Virginia Rappahannock Virginia 886
1710 Virginia Upper James River Virginia 225
1710 Virginia Virginia, port unspecified Virginia 1181
1710 Virginia York River Virginia 4404
1720 Americas Americas, port unspecified Americas 74
1720 Connecticut New London Connecticut 13
1720 Gulf coast Biloxi Gulf coast 1355
1720 Gulf coast La Balise Gulf coast 2173
1720 Gulf coast Louisiana Gulf coast 613
1720 Gulf coast New Orleans Louisiana 1127
1720 Jamaica Jamaica, place unspecified Jamaica 70
1720 Maryland Annapolis Maryland 200
1720 Maryland Londontowne Maryland 200
1720 Maryland Maryland, port unspecified Maryland 1672
1720 Maryland Patuxent Maryland 435
1720 Maryland Pocomoke Maryland 2
1720 Massachusetts Boston Massachusetts 87
1720 New Hampshire Piscataqua New Hampshire 23
1720 New Jersey Perth Amboy New Jersey 58
1720 New York New York New York 1484
1720 North Carolina North Carolina, port unspecified North Carolina 46
1720 Other North America USA, location unspecified Other North America 1
1720 Pennsylvania Philadelphia Pennsylvania 59
1720 Rhode Island Newport Rhode Island 126
1720 Rhode Island Rhode Island, port unspecified Rhode Island 132
1720 South Carolina Charleston South Carolina 5536
1720 Virginia Lower James River Virginia 8
1720 Virginia Rappahannock Virginia 2678
1720 Virginia Upper James River Virginia 217
1720 Virginia Virginia, port unspecified Virginia 3041
1720 Virginia York River Virginia 9058
1730 0 0 0 469
1730 Americas Americas, port unspecified Americas 153
1730 Connecticut Middletown Connecticut 126
1730 Florida St. Augustine Florida 7
1730 Georgia Georgia, port unspecified Georgia 17
1730 Gulf coast La Balise Gulf coast 327
1730 Gulf coast Mobile Gulf coast 9
1730 Maryland Annapolis Maryland 150
1730 Maryland Maryland, port unspecified Maryland 3604
1730 Maryland North Potomac Maryland 507
1730 Maryland Patuxent Maryland 501
1730 Maryland Pocomoke Maryland 2
1730 Massachusetts Boston Massachusetts 325
1730 New Jersey Perth Amboy New Jersey 270
1730 New York New York New York 1679
1730 North Carolina Cape Fear North Carolina 6
1730 North Carolina North Carolina, port unspecified North Carolina 223
1730 Other North America USA, location unspecified Other North America 283
1730 Pennsylvania Philadelphia Pennsylvania 351
1730 Rhode Island Providence Rhode Island 35
1730 Rhode Island Rhode Island, port unspecified Rhode Island 195
1730 South Carolina Beaufort South Carolina 230
1730 South Carolina Charleston South Carolina 23306
1730 South Carolina Georgetown South Carolina 38
1730 South Carolina South Carolina, place unspecified South Carolina 638
1730 Virginia Accomac Virginia 1
1730 Virginia Hampton Virginia 229
1730 Virginia Lower James River Virginia 1457
1730 Virginia Rappahannock Virginia 2603
1730 Virginia South Potomac Virginia 986
1730 Virginia Upper James River Virginia 1898
1730 Virginia Virginia, port unspecified Virginia 3047
1730 Virginia York River Virginia 8088
1740 0 0 0 126
1740 Canada Newfoundland Canada 2
1740 Gulf coast Mississippi Gulf coast 34
1740 Gulf coast New Orleans Louisiana 190
1740 Maryland Annapolis Maryland 83
1740 Maryland Maryland, port unspecified Maryland 2583
1740 Maryland North Potomac Maryland 217
1740 Maryland Oxford Maryland 10
1740 Maryland Patuxent Maryland 3
1740 Massachusetts Boston Massachusetts 1162
1740 New Hampshire Piscataqua New Hampshire 72
1740 New Jersey Perth Amboy New Jersey 167
1740 New York New York New York 386
1740 North Carolina Cape Fear North Carolina 71
1740 North Carolina North Carolina, port unspecified North Carolina 39
1740 Other North America USA, location unspecified Other North America 432
1740 Pennsylvania Philadelphia Pennsylvania 185
1740 Rhode Island Newport Rhode Island 146
1740 Rhode Island Providence Rhode Island 1
1740 Rhode Island Rhode Island, port unspecified Rhode Island 69
1740 South Carolina Charleston South Carolina 2425
1740 South Carolina South Carolina, place unspecified South Carolina 31
1740 Virginia Hampton Virginia 1160
1740 Virginia Lower James River Virginia 1
1740 Virginia Rappahannock Virginia 1113
1740 Virginia South Potomac Virginia 213
1740 Virginia Upper James River Virginia 3563
1740 Virginia Virginia, port unspecified Virginia 665
1740 Virginia York River Virginia 5087
1750 Americas Americas, port unspecified Americas 282
1750 Antigua Saint John (Antigua) Antigua 126
1750 Barbados Barbados, place unspecified Barbados 45
1750 Connecticut Middletown Connecticut 74
1750 Connecticut New London Connecticut 4
1750 Florida Florida, port unspecified Florida 287
1750 Georgia Georgia, port unspecified Georgia 17
1750 Georgia Savannah Georgia 146
1750 Jamaica Kingston Jamaica 178
1750 Maryland Annapolis Maryland 608
1750 Maryland Maryland, port unspecified Maryland 317
1750 Maryland North Potomac Maryland 245
1750 Maryland Nottingham Maryland 400
1750 Maryland Oxford Maryland 150
1750 Maryland Patuxent Maryland 414
1750 Maryland Pocomoke Maryland 1
1750 Massachusetts Boston Massachusetts 409
1750 New Hampshire Piscataqua New Hampshire 14
1750 New Hampshire Portsmouth (NH) New Hampshire 15
1750 New Jersey Eastern New Jersey New Jersey 74
1750 New Jersey Perth Amboy New Jersey 125
1750 New York New York New York 1937
1750 North Carolina Cape Fear North Carolina 38
1750 North Carolina North Carolina, port unspecified North Carolina 295
1750 North Carolina Portsmouth North Carolina 270
1750 Other North America Carolinas Other North America 2
1750 Other North America USA, location unspecified Other North America 5
1750 Pennsylvania Philadelphia Pennsylvania 826
1750 Rhode Island Rhode Island, port unspecified Rhode Island 1009
1750 South Carolina Beaufort South Carolina 84
1750 South Carolina Charleston South Carolina 19345
1750 South Carolina Georgetown South Carolina 9
1750 South Carolina South Carolina, place unspecified South Carolina 1258
1750 Virginia Accomac Virginia 10
1750 Virginia Bermuda Hundred Virginia 273
1750 Virginia Hampton Virginia 859
1750 Virginia Lower James River Virginia 104
1750 Virginia Rappahannock Virginia 910
1750 Virginia South Potomac Virginia 324
1750 Virginia Upper James River Virginia 3007
1750 Virginia Virginia, port unspecified Virginia 2617
1750 Virginia York River Virginia 2451
1760 Americas Americas, port unspecified Americas 138
1760 Connecticut New London Connecticut 87
1760 Danish West Indies St. Croix Danish West Indies 126
1760 Florida Pensacola Florida 199
1760 Florida St. Augustine Florida 539
1760 Georgia Georgia, port unspecified Georgia 226
1760 Georgia Savannah Georgia 3557
1760 Georgia Sunbury Georgia 128
1760 Martinique Martinique, place unspecified Martinique 170
1760 Maryland Annapolis Maryland 1227
1760 Maryland Choptank Maryland 1
1760 Maryland Londontowne Maryland 333
1760 Maryland Maryland, port unspecified Maryland 386
1760 Maryland Nanjemoy Maryland 137
1760 Maryland North Potomac Maryland 90
1760 Maryland Oxford Maryland 46
1760 Maryland Patuxent Maryland 1183
1760 Massachusetts Boston Massachusetts 511
1760 New Hampshire Piscataqua New Hampshire 6
1760 New Jersey Delaware River New Jersey 193
1760 New Jersey Eastern New Jersey New Jersey 74
1760 New York New York New York 1563
1760 North Carolina Brunswick North Carolina 8
1760 North Carolina Cape Fear North Carolina 36
1760 North Carolina New Bern North Carolina 59
1760 North Carolina North Carolina, port unspecified North Carolina 1268
1760 Other French Caribbean French Caribbean, colony unspecified Other French Caribbean 108
1760 Pennsylvania Philadelphia Pennsylvania 1149
1760 Rhode Island Newport Rhode Island 70
1760 Rhode Island Rhode Island, port unspecified Rhode Island 759
1760 South Carolina Beaufort South Carolina 60
1760 South Carolina Charleston South Carolina 28240
1760 South Carolina Georgetown South Carolina 35
1760 South Carolina South Carolina, place unspecified South Carolina 579
1760 Virginia Accomac Virginia 15
1760 Virginia Bermuda Hundred Virginia 839
1760 Virginia Hampton Virginia 349
1760 Virginia Potomac river Virginia 288
1760 Virginia Rappahannock Virginia 2225
1760 Virginia South Potomac Virginia 151
1760 Virginia Upper James River Virginia 4149
1760 Virginia Virginia, port unspecified Virginia 1231
1760 Virginia York River Virginia 264
1770 0 0 0 198
1770 Barbados Barbados, place unspecified Barbados 243
1770 Florida Florida, port unspecified Florida 64
1770 Florida Pensacola Florida 251
1770 Florida St. Augustine Florida 1004
1770 Georgia Georgia, port unspecified Georgia 187
1770 Georgia Savannah Georgia 3797
1770 Grenada Grenada, place unspecified Grenada 110
1770 Gulf coast Mississippi Gulf coast 1162
1770 Jamaica Jamaica, place unspecified Jamaica 249
1770 Jamaica Savanna la Mar Jamaica 241
1770 Maryland Annapolis Maryland 109
1770 Maryland Lower Cedar Point Maryland 132
1770 Maryland Maryland, port unspecified Maryland 151
1770 Maryland Oxford Maryland 319
1770 Maryland Patuxent Maryland 100
1770 New York New York New York 502
1770 North Carolina Brunswick North Carolina 236
1770 North Carolina New Bern North Carolina 4
1770 North Carolina North Carolina, port unspecified North Carolina 394
1770 North Carolina Portsmouth North Carolina 120
1770 North Carolina Roanoke North Carolina 203
1770 Pennsylvania Philadelphia Pennsylvania 8
1770 Saint-Domingue Cayes (Les) Saint-Domingue 553
1770 South Carolina Charleston South Carolina 23086
1770 South Carolina South Carolina, place unspecified South Carolina 363
1770 St. Kitts St. Kitts, port unspecified St. Kitts 126
1770 Virginia Bermuda Hundred Virginia 1278
1770 Virginia Georgetown Virginia 144
1770 Virginia Hampton Virginia 714
1770 Virginia Osborne’s Landing Virginia 730
1770 Virginia Rappahannock Virginia 248
1770 Virginia Upper James River Virginia 143
1770 Virginia Virginia, port unspecified Virginia 1121
1780 Canada Halifax Canada 57
1780 Canada Nova Scotia Canada 17
1780 Florida St. Augustine Florida 2
1780 Georgia Georgia, port unspecified Georgia 293
1780 Georgia Savannah Georgia 1318
1780 Gulf coast La Balise Gulf coast 432
1780 Gulf coast Louisiana Gulf coast 1151
1780 Gulf coast Mississippi Gulf coast 348
1780 Gulf coast New Orleans Louisiana 4644
1780 Jamaica Jamaica, place unspecified Jamaica 299
1780 North Carolina Beaufort North Carolina 46
1780 North Carolina Brunswick North Carolina 368
1780 North Carolina Edenton North Carolina 25
1780 North Carolina New Bern North Carolina 14
1780 North Carolina North Carolina, port unspecified North Carolina 82
1780 North Carolina Roanoke North Carolina 233
1780 North Carolina Wilmington North Carolina 12
1780 South Carolina Beaufort South Carolina 328
1780 South Carolina Charleston South Carolina 10061
1780 South Carolina Georgetown South Carolina 19
1780 South Carolina South Carolina, place unspecified South Carolina 405
1780 Virginia Virginia, port unspecified Virginia 4
1790 Florida Florida, port unspecified Florida 126
1790 Georgia Georgia, port unspecified Georgia 4
1790 Georgia Savannah Georgia 7793
1790 Gulf coast Louisiana Gulf coast 576
1790 Gulf coast New Orleans Louisiana 590
1790 Jamaica Kingston Jamaica 148
1790 North Carolina Brunswick North Carolina 2
1790 Other Caribbean Caribbean (colony unspecified) Other Caribbean 203
1790 Other North America USA, location unspecified Other North America 126
1790 South Carolina Charleston South Carolina 503
1800 Americas Americas, region unspecified Americas 127
1800 Cuba Havana Cuba 275
1800 Florida Florida, port unspecified Florida 927
1800 Florida Pensacola Florida 102
1800 Florida St. Augustine Florida 341
1800 Georgia Georgia, port unspecified Georgia 133
1800 Georgia Savannah Georgia 1822
1800 Georgia Tybee Island Georgia 358
1800 Gulf coast Louisiana Gulf coast 443
1800 Gulf coast New Orleans Louisiana 3313
1800 Maryland Pamunkey Maryland 7
1800 Other North America USA, location unspecified Other North America 92
1800 Pennsylvania Philadelphia Pennsylvania 134
1800 Rhode Island Rhode Island, port unspecified Rhode Island 158
1800 South Carolina Beaufort South Carolina 100
1800 South Carolina Charleston South Carolina 48923
1800 South Carolina South Carolina, place unspecified South Carolina 685
1800 St. Barthélemy (Sweden) St. Barthélemy, port unspecified St. Barthélemy (Sweden) 106
1800 Virginia Virginia, port unspecified Virginia 30
1810 Cuba Havana Cuba 6
1810 Florida Amelia Island Florida 353
1810 Florida Florida, port unspecified Florida 1341
1810 Georgia Georgia, port unspecified Georgia 95
1810 Georgia Savannah Georgia 309
1810 Gulf coast Louisiana Gulf coast 98
1810 Gulf coast New Orleans Louisiana 1753
1810 Other North America USA, location unspecified Other North America 350
1820 0 0 0 162
1820 Georgia Savannah Georgia 258
1820 Gulf coast New Orleans Louisiana 18265
1820 Texas Brazos Santiago Texas 1
1830 Connecticut New London Connecticut 43
1830 Georgia Savannah Georgia 5
1830 Gulf coast Mobile Gulf coast 53
1830 Gulf coast New Orleans Louisiana 18792
1830 Texas Brazoria Texas 195
1830 Texas Brazos River Texas 4
1830 Texas Galveston Texas 138
1830 Texas Matagorda Texas 83
1830 Texas Quintana Texas 1
1830 Texas Rio Grande Texas 2
1840 Georgia Savannah Georgia 194
1840 Gulf coast New Orleans Louisiana 18498
1840 Other North America USA, location unspecified Other North America 444
1840 Texas Aransas Texas 27
1840 Texas Aransas Bay Texas 29
1840 Texas Brazoria Texas 1
1840 Texas Brazos Texas 7
1840 Texas Brazos River Texas 5
1840 Texas Brazos Santiago Texas 45
1840 Texas Corpus Christi Texas 3
1840 Texas Galveston Texas 2702
1840 Texas Houston Texas 46
1840 Texas Indian Point Texas 9
1840 Texas Laureles Texas 37
1840 Texas Linn’s Landing Texas 2
1840 Texas Linnville Texas 1
1840 Texas Matagorda Texas 84
1840 Texas Matagorda Bay Texas 16
1840 Texas Port Caddo Texas 2
1840 Texas Port Isabel Texas 5
1840 Texas Port Lavaca Texas 161
1840 Texas Sabine Lake Texas 1
1840 Texas Sabine River Texas 9
1840 Texas Saluria Texas 6
1840 Texas St. Joseph’s Island Texas 2
1840 Texas Velasco Texas 1
1850 Florida Jacksonville Florida 3
1850 Georgia Georgia, port unspecified Georgia 407
1850 Georgia Savannah Georgia 2175
1850 Gulf coast New Orleans Louisiana 7235
1850 South Carolina Charleston South Carolina 3
1850 Texas Aransas Texas 1
1850 Texas Brazos Texas 4
1850 Texas Brazos Santiago Texas 21
1850 Texas Corpus Christi Texas 8
1850 Texas Galveston Texas 11409
1850 Texas Indianola Texas 2
1850 Texas Matagorda Texas 34
1850 Texas Matagorda Bay Texas 17
1850 Texas Pass Cavallo Texas 7
1850 Texas Port Lavaca Texas 30
1850 Texas Powderhorn Texas 5
1850 Texas Sabine Texas 16
1850 Texas Sabine City Texas 6
1850 Texas Sabine Pass Texas 17
1860 Florida Key West Florida 1431
1860 Gulf coast Mobile Gulf coast 108
1860 Gulf coast New Orleans Louisiana 407
1860 Texas Galveston Texas 183
1860 Texas Indianola Texas 1
# Faceted bar plot
ggplot(us_by_decade_region, aes(x = as.factor(decade), y = total_slaves_disembarked)) +
  geom_bar(stat = "identity", fill = "steelblue") +
  facet_wrap(~state, scales = "free_y") +
  labs(
    title = "Slave Imports to the US by Decade and State",
    x = "Decade",
    y = "Number of Slaves Disembarked"
  ) +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Countries Participating in Export from Africa by Decade

countries_by_decade <- trans_final %>%
  group_by(decade, nationality) %>%
  summarise(
    voyage_count = n(),
    total_slaves_embarked = sum(slaves_embarked, na.rm = TRUE),
    .groups = "drop"
  )

# Display table
countries_by_decade %>%
  knitr::kable(caption = "Countries Exporting Slaves from Africa by Decade")
Countries Exporting Slaves from Africa by Decade
decade nationality voyage_count total_slaves_embarked
1510 0 9 223
1510 Portugal / Brazil 2 624
1510 Spain / Uruguay 8 144
1520 0 3 597
1520 Spain / Uruguay 3 1043
1530 0 9 1777
1530 Portugal / Brazil 3 919
1530 Spain / Uruguay 1 224
1540 0 61 19385
1540 Portugal / Brazil 1 160
1550 0 48 16949
1550 Portugal / Brazil 2 718
1560 0 48 11791
1560 Great Britain 17 1749
1560 Portugal / Brazil 1 176
1560 Spain 1 400
1560 Spain / Uruguay 2 295
1570 0 88 29608
1570 France 2 104
1570 Portugal / Brazil 4 856
1580 0 170 52247
1580 France 2 419
1580 Portugal / Brazil 4 811
1580 Spain / Uruguay 5 1868
1590 0 179 60000
1590 Netherlands 3 697
1590 Portugal 1 159
1590 Portugal / Brazil 104 28129
1590 Spain / Uruguay 17 3087
1600 0 162 52143
1600 Denmark / Baltic 1 90
1600 Netherlands 2 922
1600 Portugal 1 216
1600 Portugal / Brazil 96 28083
1600 Spain / Uruguay 3 577
1610 0 128 40965
1610 Netherlands 1 283
1610 Portugal / Brazil 95 30278
1610 Spain / Uruguay 26 6746
1620 0 118 40639
1620 Portugal / Brazil 151 52209
1620 Spain / Uruguay 35 12811
1630 0 112 39865
1630 Netherlands 25 5268
1630 Portugal / Brazil 113 40371
1630 Spain / Uruguay 12 3965
1640 0 7 1472
1640 Denmark / Baltic 5 1400
1640 France 6 1469
1640 Great Britain 48 11261
1640 Netherlands 93 26787
1640 Other 1 325
1640 Portugal / Brazil 23 8725
1640 Spain / Uruguay 7 2256
1640 U.S.A. 3 447
1650 0 3 1100
1650 Denmark / Baltic 1 325
1650 Duchy of Courland 1 253
1650 France 1 316
1650 Great Britain 56 11772
1650 Netherlands 64 20570
1650 Portugal / Brazil 40 13464
1650 Spain / Uruguay 15 5286
1650 U.S.A. 1 181
1660 0 4 842
1660 Denmark / Baltic 1 328
1660 Duchy of Courland 1 145
1660 France 4 1264
1660 Great Britain 130 35343
1660 Netherlands 124 40525
1660 Portugal / Brazil 13 4145
1660 Spain / Uruguay 3 1207
1670 0 6 1564
1670 Denmark / Baltic 1 290
1670 France 31 9472
1670 Great Britain 146 41182
1670 Netherlands 107 43842
1670 Portugal / Brazil 26 7548
1670 Spain / Uruguay 13 4700
1670 U.S.A. 3 351
1680 0 2 696
1680 Denmark / Baltic 10 2515
1680 France 43 12573
1680 Great Britain 385 108358
1680 Netherlands 99 46272
1680 Other 1 250
1680 Portugal / Brazil 58 15508
1680 Spain / Uruguay 7 2492
1680 U.S.A. 6 915
1690 0 11 1802
1690 Denmark / Baltic 40 20167
1690 France 22 7529
1690 Great Britain 229 68577
1690 Netherlands 72 34092
1690 Portugal / Brazil 242 58379
1690 Spain / Uruguay 1 400
1690 U.S.A. 11 1609
1700 0 11 1889
1700 Denmark / Baltic 12 4707
1700 France 59 21395
1700 Great Britain 659 159288
1700 Netherlands 95 42004
1700 Portugal / Brazil 275 63338
1700 U.S.A. 7 651
1710 0 11 3125
1710 Denmark / Baltic 11 3043
1710 France 185 52091
1710 Great Britain 685 161977
1710 Netherlands 120 48959
1710 Portugal / Brazil 356 92810
1710 U.S.A. 15 1418
1720 0 9 2677
1720 Denmark / Baltic 8 1727
1720 France 232 67627
1720 Great Britain 821 204808
1720 Netherlands 79 38376
1720 Portugal / Brazil 575 185209
1720 U.S.A. 29 4028
1730 0 13 2374
1730 Denmark / Baltic 6 1034
1730 France 254 84474
1730 Great Britain 911 247635
1730 Netherlands 66 30908
1730 Portugal / Brazil 408 149532
1730 U.S.A. 94 13011
1740 0 6 904
1740 Denmark / Baltic 11 2209
1740 France 353 111487
1740 Great Britain 614 172355
1740 Netherlands 108 35501
1740 Portugal / Brazil 507 193404
1740 U.S.A. 74 10524
1750 0 4 970
1750 Denmark / Baltic 27 6029
1750 France 348 110089
1750 Great Britain 973 235913
1750 Netherlands 127 41265
1750 Portugal / Brazil 500 161415
1750 Spain / Uruguay 2 634
1750 U.S.A. 191 20473
1760 0 5 1133
1760 Denmark / Baltic 21 5915
1760 France 336 107568
1760 Great Britain 1354 340878
1760 Netherlands 185 55970
1760 Portugal 1 349
1760 Portugal / Brazil 524 165992
1760 Spain / Uruguay 11 4179
1760 U.S.A. 282 31705
1770 0 3 734
1770 Denmark / Baltic 22 6123
1770 France 499 174639
1770 Great Britain 1251 325715
1770 Netherlands 176 49944
1770 Portugal 1 448
1770 Portugal / Brazil 450 135352
1770 Spain / Uruguay 1 36
1770 U.S.A. 197 26272
1780 0 4 751
1780 Austria 8 2602
1780 Denmark / Baltic 50 17046
1780 France 607 213516
1780 Great Britain 776 255157
1780 Netherlands 63 18394
1780 Portugal 1 581
1780 Portugal / Brazil 589 186610
1780 Spain / Uruguay 3 533
1780 U.S.A. 85 10598
1790 0 8 1695
1790 Denmark / Baltic 63 10039
1790 France 380 118201
1790 Great Britain 1217 357289
1790 Netherlands 38 9391
1790 Portugal 1 364
1790 Portugal / Brazil 704 238028
1790 Spain / Uruguay 20 5128
1790 Sweden 1 191
1790 U.S.A. 306 37869
1800 0 10 3082
1800 Denmark / Baltic 102 16815
1800 France 69 16676
1800 Great Britain 1112 319243
1800 Netherlands 8 1919
1800 Portugal / Brazil 841 336155
1800 Spain / Uruguay 48 9482
1800 U.S.A. 630 95768
1810 0 10 2087
1810 Denmark / Baltic 2 176
1810 France 94 21607
1810 Portugal 1 6
1810 Portugal / Brazil 1359 503599
1810 Spain / Uruguay 749 190536
1810 U.S.A. 25 3442
1820 0 20 5985
1820 Bremen 1 318
1820 Denmark / Baltic 3 530
1820 France 504 129177
1820 Netherlands 7 1577
1820 Portugal / Brazil 1454 564328
1820 Spain / Uruguay 324 102374
1820 U.S.A. 8 2260
1830 0 34 13416
1830 Denmark / Baltic 2 831
1830 France 34 10921
1830 Other 2 751
1830 Portugal / Brazil 875 356960
1830 Spain / Uruguay 398 148603
1830 U.S.A. 12 5978
1840 0 321 154602
1840 Denmark / Baltic 5 2026
1840 France 18 8575
1840 Other 3 1110
1840 Portugal 2 106
1840 Portugal / Brazil 554 239076
1840 Spain 1 104
1840 Spain / Uruguay 57 23006
1840 U.S.A. 42 26754
1850 0 162 89161
1850 France 1 490
1850 Other 1 324
1850 Portugal / Brazil 60 26497
1850 Spain / Uruguay 55 26714
1850 U.S.A. 67 45846
1860 0 60 41101
1860 France 3 1805
1860 Other 1 1250
1860 Portugal / Brazil 1 723
1860 Spain / Uruguay 11 5466
1860 U.S.A. 49 33323

Summary

This analysis of the Trans-Atlantic and Intra-American slave trade datasets reveals the scale and patterns of forced migration. Approximately 360,167 slaves were imported to the US, constituting about 3.53% of the total slaves embarked from Africa in the Trans-Atlantic trade. Slave imports to the US peaked in certain decades, driven by economic and political factors, as shown in a bar plot by decade. A faceted bar plot and table by state highlight regional differences, with ports like New Orleans (Louisiana) and Charleston (South Carolina) as key entry points. Multiple nations exported slaves from Africa, with voyage counts and slave numbers varying by decade, reflecting shifts in colonial trade networks. These findings underscore the immense human toll, regional variations, and historical context of the slave trade.