DOI: 10.13020/7h2q-qw35
title: R Code, Data, and Output Supporting: Facilitating effective collaboration to prevent aquatic invasive species spread

description: This repository contains R code, raw and processed data, and associated outputs supporting the results reported in: Kinsley, A, Bajcz A, Haight R, and Phelps N. 2023. Facilitating effective collaboration to prevent aquatic invasive species spread. Biological Invasions [in press]. In brief, this repository provides the inputs, code, and documentation for our process of generating optimization models, using linear integer programming (LIP) in R, that would find optimal placement patterns for watercraft inspection stations to thwart the movement of boats at risk of carrying aquatic invasive species from one lake to another within the state of Minnesota, given certain assumptions about how jurisdictional authority operates within the state.
description: There are more files provided in the archive than are summarized here. However, all those not specifically described in this section are referenced, described, or created in the files listed below. Please consult the files listed here for details. 1. statelevel_modelMSI.R, countylevel_model.R, and collablevel_model.R - These files run ssentially the same optimization model problem: How do we place inspection stations around the state of Minnesota at lakes within various jurisdictions optimally to intercept the most boats at risk of carrying and spreading aquatic invasive species as we can? The three variations on this model reflected by these three files revolve around changing how jurisdictional boundaries and authority work. The "MSI" tag on the first of these files indicates that, to successfully run the code, the Minnesota Supercomputing Institute (MSI) was used--that code may not be runnable on a standard personal computer. 2. interpretting_lakes_selected_x_files.R - This files does the post-processing needed to convert the raw vectors of lakes selected in each optimization model run (the lakes_selected_county, lakes_selected_collabs_, and lakes_selected_state RDS files) into numbers of risky boats intercepted, as reflected in the model_results.png graphic. 3. statelevel_modelMSI_makemod.R, processing_statewide_model.R, and making boats_reduce files.R - These scripts are supplementary R code files that help to generate inputs or outputs of the other files listed above and are explained further via annotations within the documents themselves. 4. statewide_modelMSI.sh and statelevel_modelMSI_makemod.sh - These are the bash batch script files used to run the state-level optimization model on MSI. 5. countymod_budgets.csv and collabmod_budgets_collabsandcounties.csv - These two CSV files list, along the rows, the various counties in Minnesota receiving budgets in the optimization models with which to place inspection states. Along the columns are several possible budget levels ranging from 10 up 700 stations. In the cells are the numbers of stations alloted to each county. The former is used in the county-level model and the latter in the collaborations model, the only difference being that some counties have been essentially "combined" into one unit for the latter. These budget allocations were arrived at using a workflow outlined in another file, the budget_determination_workflow.xlsx file, towards the bottom in comments attached to specific cells. 6. lake_info.csv and Lakes_total_collabs.csv - These contain data that are raw inputs to the optimization models and are explained in greater depth in the DATA-SPECIFIC INFORMATION section below. 7. boats_adjSWF, boats_reduce, and boats_reduce_noswf - These are RDS data files that are inputs to the optimization models. They are explained in greater detail in the making boats_reduce files.R. 8. statewide_model_results - This folder contains per-budget-level vector RDS objects containing the specific lakes selected for inspection stations in the statewide model. This alternative format for these results is due to the fact that the each budget level was ran in a separate batch job on MSI to efficiently use processing time and thus must be "stitched back together" to take on a similar form as the outputs of the other two versions -- see the files processing_statewide_model.R for details. 9. Kaos' boater networks - These are products of an earlier study; they are the estimated numbers of boat trips occurring between every pair of lakes in the state of Minnesota yearly, as predicted by a machine learning model. These are used here to generate the boats.n.ij object that is a key input to the models.