| Title: | Tools for Analyzing Cross-National Military Deployment and Basing Data |
|---|---|
| Description: | These functions generate data frames on troop deployments and military basing using U.S. Department of Defense data on overseas military deployments. This package provides functions for pulling country-year troop deployment and basing data. Subsequent versions will hopefully include cross-national data on deploying countries. |
| Authors: | Michael Flynn [aut, cre] (ORCID: <https://orcid.org/0000-0002-6064-740X>) |
| Maintainer: | Michael Flynn <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.4.9000 |
| Built: | 2026-06-02 18:44:50 UTC |
| Source: | https://github.com/meflynn/troopdata |
Generate customized data frames containing U.S. military deployment data
The troopdata package contains functions for generating customized data sets on U.S. military
deployment data and U.S. overseas basing data. The data contain country identifiers that can be used to merge
these data with other data to analyze trends in the United States' overseas military posture.
Michael E. Flynn [email protected]
https://www.m-flynn.com/ https://github.com/meflynn/troopdata
Useful links:
Report bugs at https://github.com/meflynn/troopdata/issues
basedata returns a data frame containing David Vine's US basing data.
basedatabasedata
A data frame with country-base observations including the following variables:
countrynameA character vector of country names.
ccodeA numeric vector of Correlates of War country codes.
iso3cA character vector of ISO three character country codes.
basenameName of the facility.
latThe facility's latitude.
lonThe facility's longitude.
baseBinary indicator identifying the facility as a major base or not.
lilypadA binary indicator identifying the facility as a lilypad or not. Vine codes lilypads as less than 200 personnel or "other site" designation in Pentagon reports.
fundedsiteA binary variable indicating whether or not the facility is a host-state base funded by the US.
Returns the full data frame containing country observations of US military bases from the Cold War period through 2018.
builddata returns a data frame containing geocoded location-project-year overseas military construction spending data.
builddatabuilddata
A data frame with country-base observations including the following variables:
countrynameA character vector of country names.
ccodeA numeric vector of Correlates of War country codes.
yearYear of observed country-year spending.
iso3cA character vector of ISO three character country codes.
locationName of the facility where spending occurred, or host country where detailed facility information is unavailable.
spend_constructionTotal obligational authority associated with the observed location-year in thousands of current US dollars.
latThe facility's latitude.
lonThe facility's longitude.
Returns the full data frame containing location-project-year observations of U.S. military construction spending data from 2008-2019.
get_basedata() generates a customized data frame containing data obtained from David Vine's U.S. basing data.
get_basedata(host = NA, country_count = FALSE, groupvar = NULL)get_basedata(host = NA, country_count = FALSE, groupvar = NULL)
host |
The Correlates of War (COW) numeric country code or ISO3C code for the host country or countries in the series |
country_count |
Logical. Should the function return a country-level count of the total number of bases or the country-site data |
groupvar |
A character string indicating how country count totals should be generated. Accepted values are 'countryname', 'ccode', or 'iso3c'. Can take on Required when using country_count argument. |
Our research team updated these data through 2018.
get_basedata() returns a data frame containing information on U.S. military bases present within selected host countries. This can be customized to include country-base observations or country-count observations.
Michael E. Flynn
David Vine. 2015. Base Nation. Metropolitan Books. New York, NY.
## Not run: library(tidyverse) library(troopdata) example <- get_basedata(host = NA) head(example) ## End(Not run)## Not run: library(tidyverse) library(troopdata) example <- get_basedata(host = NA) head(example) ## End(Not run)
get_builddata() generates a customized data frame containing location-project-year observations of U.S. military construction and housing spending in thousands of current dollars.
get_builddata(host = NA, startyear, endyear)get_builddata(host = NA, startyear, endyear)
host |
The Correlates of War (COW) numeric country code or ISO3C code for the host country or countries in the series |
startyear |
The first year for the series |
endyear |
The last year for the series |
get_builddata() returns a data frame containing location-project-year observations of U.S. military construction and housing spending in thousands of current dollars.
Michael E. Flynn
Michael A. Allen, Michael E. Flynn, and Carla Martinez Machain. 2020. "Outside the wire: US military deployments and public opinion in host states." American Political Science Review. 114(2): 326-341.
## Not run: library(tidyverse) library(troopdata) example <- get_builddata(host = NA, startyear = 2008, endyear = 2019) head(example) ## End(Not run)## Not run: library(tidyverse) library(troopdata) example <- get_builddata(host = NA, startyear = 2008, endyear = 2019) head(example) ## End(Not run)
get_exercises() generates a customized data frame
containing exercise-country-year observations of multilateral military
exercises. Users can subset the data by participating country, year,
exercise duration, geographic location, exercise name, the
domain(s) of the exercise (e.g., air, land, sea), the mission focus
(warfighting, humanitarian, peacekeeping), and the number of
participating countries.
get_exercises( country = NULL, startyear = NULL, endyear = NULL, min_duration = NULL, max_duration = NULL, location = NULL, exercise_name = NULL, domain = NULL, focus = NULL, min_participants = NULL, max_participants = NULL )get_exercises( country = NULL, startyear = NULL, endyear = NULL, min_duration = NULL, max_duration = NULL, location = NULL, exercise_name = NULL, domain = NULL, focus = NULL, min_participants = NULL, max_participants = NULL )
country |
The Gleditsch and Ward (G&W) numeric country code or country
name for the participating country or countries to include. Numeric input
is matched exactly against the |
startyear |
The first year for the series. The default is set to the minimum year in the currently published data. |
endyear |
The last year for the series. The default is the maximum year in the currently published data. |
min_duration |
Numeric. Minimum exercise duration in days (inclusive). Default is NULL (no minimum filter). |
max_duration |
Numeric. Maximum exercise duration in days (inclusive). Default is NULL (no maximum filter). |
location |
Character. A string or vector of strings used to subset
exercises by geographic location. Matched against the |
exercise_name |
Character. A string or vector of strings used to
subset exercises by name. Matched against both the |
domain |
Character. A string or vector of strings indicating one or
more exercise domains (warfighting environments) to include. Accepted
values are |
focus |
Character. A string or vector of strings indicating one or
more mission focuses to include. Accepted values are
|
min_participants |
Numeric. Minimum number of participating countries in the exercise (inclusive). Default is NULL (no minimum filter). |
max_participants |
Numeric. Maximum number of participating countries in the exercise (inclusive). Default is NULL (no maximum filter). |
get_exercises() returns a data frame containing
exercise-country-year observations of multilateral military exercises
that match the specified filter criteria.
Michael E. Flynn
D'Orazio, Vito; Galambos, Kevin, 2021, "Multinational Military Exercises, 1980-2010", https://doi.org/10.7910/DVN/KHFODX, Harvard Dataverse, V1.
Gleditsch, Kristian S., and Michael D. Ward. 1999. "Interstate System Membership: A Revised List of the Independent States since 1816." International Interactions 25(4): 393-413.
## Not run: library(tidyverse) library(troopdata) # Pull all exercises that include South Korea between 2000 and 2015. korea_exercises <- get_exercises(country = "korea", startyear = 2000, endyear = 2015) # Pull all naval and amphibious exercises lasting at least 5 days. sea_exercises <- get_exercises(domain = c("sea", "amphibious"), min_duration = 5) # Pull all "Cobra Gold" exercises in Thailand. cobra_gold <- get_exercises(exercise_name = "cobra gold", location = "thailand") # Pull large-scale humanitarian exercises (10 or more participants). large_hadr <- get_exercises(focus = "humanitarian", min_participants = 10) ## End(Not run)## Not run: library(tidyverse) library(troopdata) # Pull all exercises that include South Korea between 2000 and 2015. korea_exercises <- get_exercises(country = "korea", startyear = 2000, endyear = 2015) # Pull all naval and amphibious exercises lasting at least 5 days. sea_exercises <- get_exercises(domain = c("sea", "amphibious"), min_duration = 5) # Pull all "Cobra Gold" exercises in Thailand. cobra_gold <- get_exercises(exercise_name = "cobra gold", location = "thailand") # Pull large-scale humanitarian exercises (10 or more participants). large_hadr <- get_exercises(focus = "humanitarian", min_participants = 10) ## End(Not run)
get_troopdata() generates a customized data frame containing country-year observations of U.S. military deployments overseas.
get_troopdata( host = NULL, branch = FALSE, startyear = 1950, endyear = 2025, quarters = FALSE, guard_reserve = FALSE, civilians = FALSE, state_data = FALSE, reports = FALSE )get_troopdata( host = NULL, branch = FALSE, startyear = 1950, endyear = 2025, quarters = FALSE, guard_reserve = FALSE, civilians = FALSE, state_data = FALSE, reports = FALSE )
host |
The Correlates of War (COW) numeric country code, ISO3C code, or country name, for the host country or countries in the series. If region == TRUE the user can specify a COW region name and the function will try to match it to the region column in the data. The default is NA. |
branch |
Logical. Should the function return a single vector containing total troop values or multiple vectors containing total values and values for individual branches? Default is FALSE. |
startyear |
The first year for the series. The default is set to 1950. |
endyear |
The last year for the series. The default is the maximum year in the currently published data. |
quarters |
Logical. Should the function return quarterly data? Default is FALSE. |
guard_reserve |
Logical. Should the function return values for the National Guard and Reserve? Default is FALSE. |
civilians |
Logical. Should the function return values for civilian DoD personnel? Default is FALSE. |
state_data |
Logical. Should the function return disaggregated data on US States? Default is FALSE. |
reports |
Logical. Should the function return reports for the specified countries and years? Default is FALSE. |
get_troopdata() returns a data frame containing country-year observations for U.S. troop deployments.
Michael E. Flynn
Tim Kane. Global U.S. troop deployment, 1950-2003. Technical Report. Heritage Foundation, Washington, D.C.
Michael A. Allen, Michael E. Flynn, and Carla Martinez Machain. 2022. "Global U.S. military deployment data: 1950-2020." Conflict Management and Peace Science. 39(3): 351-370.
## Not run: library(tidyverse) library(troopdata) example <- get_troopdata(host = "United States", branch = TRUE, startyear = 1980, endyear = 2015) head(example) ## End(Not run)## Not run: library(tidyverse) library(troopdata) example <- get_troopdata(host = "United States", branch = TRUE, startyear = 1980, endyear = 2015) head(example) ## End(Not run)
mme_long returns a data frame containing
exercise-country-year observations of multilateral military exercises.
Built from the MME version 7 data (https://doi.org/10.7910/DVN/KHFODX)
and reshaped so each row represents a single participating country in
a single year of a single exercise. This is the data object underlying
get_exercises().
mme_longmme_long
A data frame with exercise-country-year observations including the following variables:
MMEIDUnique exercise identifier from the MME source data.
Ex_NameThe name of the individual exercise (e.g., "Cobra Gold 23").
Series_NameThe name of the broader exercise series the exercise belongs to (e.g., "Cobra Gold").
gwcodeNumeric Gleditsch and Ward country code for the
participating country. Looked up from country via the
countrycode package; NA for non-country participants
such as "NATO" or regional groupings.
countryCharacter vector of participating country names as recorded in the MME source data.
yearThe year of the observation. Exercises spanning
multiple years are expanded so that each year between s.year
and e.year produces its own row.
LocationThe geographic location where the exercise was held (free-text from the source data).
latLatitude of the exercise location.
lonLongitude of the exercise location.
StartDateOriginal start-date string from the source data.
s.yearNumeric year the exercise began.
s.monthNumeric month the exercise began.
s.dayNumeric day the exercise began (may be "xx"
when unknown).
EndDateOriginal end-date string from the source data.
e.yearNumeric year the exercise ended.
e.monthNumeric month the exercise ended.
e.dayNumeric day the exercise ended (may be "xx"
when unknown).
CPXBinary indicator: command post exercise.
AirBinary indicator: air domain.
LandBinary indicator: land domain.
SeaBinary indicator: sea domain.
AmphibiousBinary indicator: amphibious domain.
CyberBinary indicator: cyber domain.
WarfightingBinary indicator: warfighting focus.
PeacekeepingBinary indicator: peacekeeping focus.
HumanitarianBinary indicator: humanitarian focus.
FocusDescriptionFree-text description of the exercise's focus from the source data.
AdditionalParticipantInfoFree-text notes about participants from the source data.
participant_countTotal number of participating countries
in the exercise. The same value is repeated across all rows that share
an MMEID. Used by the min_participants and max_participants
arguments of get_exercises().
Returns the full data frame of exercise-country-year observations of multilateral military exercises from 1980 forward.
D'Orazio, Vito; Galambos, Kevin, 2021, "Multinational Military Exercises, 1980-2010", doi:10.7910/DVN/KHFODX, Harvard Dataverse, V1.
troopdata returns a data frame containing information on US military deployments.
troopdata_rebuild_longtroopdata_rebuild_long
A data frame with country year observations including the following variables:
ccodeA numeric vector of Correlates of War country codes.
iso3cA character vector of ISO three character country codes.
countrynameA character vector of country names.
regionCorrelates of War geographic region name.
yearThe year of the observation.
monthThe month of the observation.
quarterThe quarter of the observation.
year_quarterThe year and quarter of the observation.
sourceThe DMDC report source of the observation.
troops_adThe total number of active duty US military personnel deployed to the host country.
troops_allThe total number of US military personnel deployed to the host country including guard and reserve.
army_adTotal number of active duty Army personnel deployed to the host country.
navy_adTotal number of active duty Navy personnel deployed to the host country.
air_force_adTotal number of active duty Air Force personnel deployed to the host country.
space_force_adTotal number of active duty Space Force personnel deployed to the host country.
marine_corps_adTotal number of Marine Corps personnel deployed to the host country.
coast_guard_adTotal number of Coast Guard personnel deployed to the host country.
total_selected_reserveTotal number of reserve US military personnel deployed to the host country.
army_reserveTotal number of reserve Army personnel deployed to the host country.
navy_reserveTotal number of reserve Navy personnel deployed to the host country.
air_force_reserveTotal number of reserve Air Force personnel deployed to the host country.
marine_corps_reserveTotal number of reserve Marine Corps personnel deployed to the host country.
coast_guard_reserveTotal number of reserve Coast Guard personnel deployed to the host country.
army_national_guardTotal number of Army National Guard personnel deployed to the host country.
air_national_guardTotal number of Air National Guard personnel deployed to the host country.
army_civilianTotal number of Army civilian personnel deployed to the host country.
navy_civilianTotal number of Navy civilian personnel deployed to the host country.
air_force_civilianTotal number of Air Force civilian personnel deployed to the host country.
marine_corps_civilianTotal number of Marine Corps civilian personnel deployed to the host country.
dod_civilianTotal number of Department of Defense civilian personnel deployed to the host country.
total_civilianTotal number of civilian personnel deployed to the host country.
Returns the full data frame containing observations of US military deployments to overseas locations (countries and territories) from 1950 through 2024.
https://www.heritage.org/defense/report/global-us-troop-deployment-1950-2005
troopdata_rebuild_reports returns a data frame containing DMDC reports on US military deployments.
troopdata_rebuild_reportstroopdata_rebuild_reports
A data frame with country year quarter observations including the following variables:
ccodeA numeric vector of Correlates of War country codes.
iso3cA character vector of ISO three character country codes.
countrynameA character vector of country names.
regionCorrelates of War geographic region name.
yearThe year of the observation.
monthThe month of the observation.
quarterThe quarter of the observation.
sourceThe DMDC report source of the observation.
LocationThe geographic location listed in the DMDC reports.
Total"Total number of US military personnel deployed to the host country.
Total Ashore"Total number of US military personnel deployed to the host country, excluding those at sea.
Total Afloat"Total number of US military personnel deployed to the host country, at sea.
Army TotalTotal number of Army personnel deployed to the host country.
Navy AshoreTotal number of Navy personnel deployed to the host country, excluding those at sea.
Navy Temporary AshoreTotal number of Navy personnel deployed to the host country, temporarily.
Navy OtherTotal number of Navy personnel deployed to the host country, in other capacities.
Marine Corps AshoreTotal number of Marine Corps personnel deployed to the host country, excluding those at sea.
Marine Corps AfloatTotal number of Marine Corps personnel deployed to the host country, at sea.
Air Force TotalTotal number of Air Force personnel deployed to the host country.
Navy AfloatTotal number of Navy personnel deployed to the host country, at sea.
Navy TotalTotal number of Navy personnel deployed to the host country.
Marine Corps TotalTotal number of Marine Corps personnel deployed to the host country.
troops_adThe total number of active duty US military personnel deployed to the host country.
army_adTotal number of active duty Army personnel deployed to the host country.
navy_adTotal number of active duty Navy personnel deployed to the host country.
marine_corps_adTotal number of active duty Marine Corps personnel deployed to the host country.
space_force_adTotal number of active duty Space Force personnel deployed to the host country.
air_force_adTotal number of active duty Air Force personnel deployed to the host country.
coast_guard_adTotal number of Coast Guard personnel deployed to the host country.
Macro LocationThe geographic location listed in the DMDC reports.
Army Active DutyTotal number of active duty Army personnel deployed to the host country.
Navy Active DutyTotal number of active duty Navy personnel deployed to the host country.
Marine Corps Active DutyTotal number of active duty Marine Corps personnel deployed to the host country.
Air Force Active DutyTotal number of active duty Air Force personnel deployed to the host country.
Coast Guard Active DutyTotal number of active duty Coast Guard personnel deployed to the host country.
Space Force Active DutyTotal number of active duty Space Force personnel deployed to the host country.
Total Active DutyTotal number of active duty US military personnel deployed to the host country.
Army National GuardTotal number of Army National Guard personnel deployed to the host country.
Army ReserveTotal number of reserve Army personnel deployed to the host country.
Navy ReserveTotal number of reserve Navy personnel deployed to the host country.
Marine Corps ReserveTotal number of reserve Marine Corps personnel deployed to the host country.
Air National GuardTotal number of Air National Guard personnel deployed to the host country.
Air Force ReserveTotal number of reserve Air Force personnel deployed to the host country.
Coast Guard ReserveTotal number of reserve Coast Guard personnel deployed to the host country.
Total Selected ReserveTotal number of reserve US military personnel deployed to the host country.
Army CivilianTotal number of Army civilian personnel deployed to the host country.
Navy CivilianTotal number of Navy civilian personnel deployed to the host country.
Marine Corps CivilianTotal number of Marine Corps civilian personnel deployed to the host country.
Air Force CivilianTotal number of Air Force civilian personnel deployed to the host country.
DOD CivilianTotal number of Department of Defense civilian personnel deployed to the host country.
Total CivilianTotal number of civilian personnel deployed to the host country.
Grand TotalTotal number of US military and civilian personnel deployed to the host country.
Returns a data frame containing DMDC reports of US military deployments to overseas locations from 1950 through 2024.
https://www.heritage.org/defense/report/global-us-troop-deployment-1950-2005
troopdata_rebuild_us_states returns a data frame
containing information on U.S. military personnel stationed in each of
the 50 U.S. states (and U.S. territories where reported). Returned by
get_troopdata() when the state_data argument is set to
TRUE.
troopdata_rebuild_us_statestroopdata_rebuild_us_states
A data frame with state-year (and state-year-quarter) observations including the following variables:
fipscodeA numeric vector of U.S. Federal Information
Processing Standards (FIPS) state codes. Used as the numeric identifier
when subsetting via get_troopdata(host = <numeric>, state_data = TRUE).
stateA character vector of U.S. state names. Matched with a
case-insensitive grepl fuzzy match when subsetting via
get_troopdata(host = <character>, state_data = TRUE).
yearThe year of the observation.
monthThe month of the observation.
quarterThe quarter of the observation.
troops_adThe total number of active duty US military personnel stationed in the state.
army_adTotal number of active duty Army personnel stationed in the state.
navy_adTotal number of active duty Navy personnel stationed in the state.
air_force_adTotal number of active duty Air Force personnel stationed in the state.
marine_corps_adTotal number of active duty Marine Corps personnel stationed in the state.
coast_guard_adTotal number of active duty Coast Guard personnel stationed in the state.
space_force_adTotal number of active duty Space Force personnel stationed in the state.
army_national_guardTotal number of Army National Guard personnel stationed in the state.
air_national_guardTotal number of Air National Guard personnel stationed in the state.
army_reserveTotal number of Army Reserve personnel stationed in the state.
navy_reserveTotal number of Navy Reserve personnel stationed in the state.
marine_corps_reserveTotal number of Marine Corps Reserve personnel stationed in the state.
air_force_reserveTotal number of Air Force Reserve personnel stationed in the state.
coast_guard_reserveTotal number of Coast Guard Reserve personnel stationed in the state.
total_selected_reserveTotal number of reserve US military personnel stationed in the state.
army_civilianTotal number of Army civilian personnel stationed in the state.
navy_civilianTotal number of Navy civilian personnel stationed in the state.
air_force_civilianTotal number of Air Force civilian personnel stationed in the state.
marine_corps_civilianTotal number of Marine Corps civilian personnel stationed in the state.
dod_civilianTotal number of Department of Defense civilian personnel stationed in the state.
total_civilianTotal number of civilian personnel stationed in the state.
Returns the full data frame containing state-year (and state-year-quarter) observations of U.S. military personnel stationed domestically from 1950 through the most recent reporting period.
https://www.heritage.org/defense/report/global-us-troop-deployment-1950-2005