Code
library(tidyverse)
library(usefun)
library(ggplot2)
library(here)
library(patchwork)
library(scales)
library(geosphere)
library(terra)
library(raster)
library(sf)
library(viridis)
library(pals)
<- dplyr::select select
Load R-packages needed to execute code
Load custom functions to process InterSpread Plus outputs and generate figures. These are available from the linked repository at the top of the script.
import_infection_data()
reads the Outputs_Infection.txt
files that include data on simulated infection events.
Check the number of infection events
Check infect_day
statistics
Check the number of infection events
[1] 2224274
Check infect_day
statistics
Check the number of infection events
[1] 1990653
Check infect_day
statistics
import_detection_data()
reads the Outputs_Detection.txt
files that include data on simulated detection events.
Check the number of detection events
Check detect_day
statistics
Check the number of detection events
[1] 2190070
Check detect_day
statistics
Check the number of detection events
[1] 1964277
Check detect_day
statistics
The FMD Farm Reference File used for this project contains geographic coordinates for theoretical farm locations. Premises data were generated using the Farm Location and Agricultural Production Simulator (FLAPS, see Burdett et al. 2015) and do not reflect true farm locations. Farm demographics are based upon data collected in the U.S. Census of Agriculture conducted by the USDA National Agricultural Statistical Service (NASS).
reference <- read.csv2(here("script-inputs/reference-files/FMD_Reference_File.csv"), header=TRUE, sep=",")
colnames(reference) <- c(
"premises",
"class",
"cattle",
"weight",
"x",
"y",
"state",
"longitude",
"latitude",
"geo_region"
)
## Select columns needed for spread analyses
reference <- reference %>%
mutate(longitude = as.numeric(longitude),
latitude = as.numeric(latitude)) %>%
select(-c(weight, cattle, x, y, geo_region))
nrow(reference)
[1] 889759
Each row in reference
contains data for a unique, theoretical cattle premises. This data is used to simulate FMDV-spread between cattle farms throughout the United States.