Skip to contents

Obtaining MRIP Data

Data pulls from NOAA Fisheries’ Marine Recreational Information Program (MRIP) can be done through the MRIP Query Tool website.

Alternatively, queries for recreational trips, catch, and landings can be performed using the functions in this package.

This vignette shows example data pulls and plots used for Black Sea Bass:

  • Total Recreational Catch and Landings

  • Total Recreational Trips

Black Sea Bass Recreational Catch and Landings

Pull data

Get recreational catch data for Black Sea Bass using the get_mrip_catch function. The type argument can be set to “all” for all catch types (A, B1, B2) or “landings” for just the landings (A and B1).

bsb_catch <- get_mrip_catch(species = "BLACK SEA BASS", 
                            type = "all", 
                            region = "north and mid-atlantic")
head(bsb_catch)
## $data
## # A tibble: 44 × 14
##    `Estimate Status`  Year `Fishing Year`     `Common Name` `Cumulative Through`
##    <chr>             <int> <chr>              <chr>         <chr>               
##  1 FINAL              1981 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  2 FINAL              1982 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  3 FINAL              1983 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  4 FINAL              1984 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  5 FINAL              1985 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  6 FINAL              1986 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  7 FINAL              1987 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  8 FINAL              1988 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  9 FINAL              1989 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
## 10 FINAL              1990 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
## # ℹ 34 more rows
## # ℹ 9 more variables: `PSE Total Catch (A+B1+B2)` <dbl>,
## #   `Does Total Catch (A+B1+B2) Meet MRIP Standard` <chr>,
## #   `Is Total Catch (A+B1+B2) Significantly Different From 0` <chr>,
## #   `Total Catch (A+B1+B2)` <chr>,
## #   `Total Catch (A+B1+B2) Lower 95% Confidence Limit` <chr>,
## #   `Total Catch (A+B1+B2) Upper 95% Confidence Limit` <chr>, …
## 
## $metadata
## # A tibble: 13 × 2
##    X2                                                                      X3   
##    <chr>                                                                   <chr>
##  1 ""                                                                      ""   
##  2 "Your Query Parameters:"                                                "You…
##  3 "Query:"                                                                "MRI…
##  4 "Year:"                                                                 "198…
##  5 "Summarize By:"                                                         "ANN…
##  6 "Fishing Year:"                                                         "CAL…
##  7 "Species:"                                                              "BLA…
##  8 "Geographic Area:"                                                      "NOR…
##  9 "Fishing Mode:"                                                         "ALL…
## 10 "Fishing Area:"                                                         "ALL…
## 11 "Type of Catch:"                                                        "TOT…
## 12 "Information:"                                                          "NUM…
## 13 "Notes on Query Results:        MRIP does not support the use of estim… "Not…
## 
## $url
## [1] "https://www.st.nmfs.noaa.gov/SASStoredProcess/guest?_program=%2F%2FFoundation%2FSTP%2Fmrip_series_catch&qyearfrom=1981&qyearto=2024&qsummary=cumulative_pya&qwave=1&fshyr=annual&qstate=NORTH+AND+MID-ATLANTIC&qspecies=BLACK%20SEA%20BASS&qmode_fx=ALL+MODES+COMBINED&qarea_x=ALL+AREAS+COMBINED&qcatch_type=TOTAL+CATCH+%28TYPE+A+%2B+B1+%2B+B2%29&qdata_type=NUMBERS+OF+FISH&qoutput_type=TABLE&qsource=PRODUCTION"
bsb_landings <- get_mrip_catch(species = "BLACK SEA BASS",
                               type = "landings", 
                               region = "north and mid-atlantic")
head(bsb_landings)
## $data
## # A tibble: 44 × 14
##    `Estimate Status`  Year `Fishing Year`     `Common Name` `Cumulative Through`
##    <chr>             <int> <chr>              <chr>         <chr>               
##  1 FINAL              1981 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  2 FINAL              1982 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  3 FINAL              1983 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  4 FINAL              1984 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  5 FINAL              1985 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  6 FINAL              1986 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  7 FINAL              1987 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  8 FINAL              1988 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
##  9 FINAL              1989 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
## 10 FINAL              1990 CALENDAR YEAR (JA… BLACK SEA BA… ANNUAL              
## # ℹ 34 more rows
## # ℹ 9 more variables: `PSE Total Harvest (A+B1)` <dbl>,
## #   `Does Total Harvest (A+B1) Meet MRIP Standard` <chr>,
## #   `Is Total Harvest (A+B1) Significantly Different From 0` <chr>,
## #   `Total Harvest (A+B1)` <chr>,
## #   `Total Harvest (A+B1) Lower 95% Confidence Limit` <chr>,
## #   `Total Harvest (A+B1) Upper 95% Confidence Limit` <chr>, …
## 
## $metadata
## # A tibble: 13 × 2
##    X2                                                                      X3   
##    <chr>                                                                   <chr>
##  1 ""                                                                      ""   
##  2 "Your Query Parameters:"                                                "You…
##  3 "Query:"                                                                "MRI…
##  4 "Year:"                                                                 "198…
##  5 "Summarize By:"                                                         "ANN…
##  6 "Fishing Year:"                                                         "CAL…
##  7 "Species:"                                                              "BLA…
##  8 "Geographic Area:"                                                      "NOR…
##  9 "Fishing Mode:"                                                         "ALL…
## 10 "Fishing Area:"                                                         "ALL…
## 11 "Type of Catch:"                                                        "HAR…
## 12 "Information:"                                                          "NUM…
## 13 "Notes on Query Results:        MRIP does not support the use of estim… "Not…
## 
## $url
## [1] "https://www.st.nmfs.noaa.gov/SASStoredProcess/guest?_program=%2F%2FFoundation%2FSTP%2Fmrip_series_catch&qyearfrom=1981&qyearto=2024&qsummary=cumulative_pya&qwave=1&fshyr=annual&qstate=NORTH+AND+MID-ATLANTIC&qspecies=BLACK%20SEA%20BASS&qmode_fx=ALL+MODES+COMBINED&qarea_x=ALL+AREAS+COMBINED&qcatch_type=HARVEST+%28TYPE+A+%2B+B1%29&qdata_type=NUMBERS+OF+FISH&qoutput_type=TABLE&qsource=PRODUCTION"

Wrangle data

The function returns a list with the data and query metadata. These data can be used directly for analyses, with minimal data wrangling. The data can be formatted for use in ESPs with the function create_total_mrip().

esp_catch <- create_total_mrip(bsb_catch$data,
  var_name = "catch"
)
## Removing data that does not meet MRIP standards. If you want to keep this data, set `remove_non_standard = FALSE`.
head(esp_catch) |>
  knitr::kable()
YEAR DATA_VALUE LOWER_95_CI UPPER_95_CI CATEGORY INDICATOR_TYPE INDICATOR_NAME INDICATOR_UNITS SPECIES REGION
1981 7680855 258998 15102712 Recreational Socioeconomic total_recreational_catch_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1982 12824985 9129850 16520119 Recreational Socioeconomic total_recreational_catch_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1983 8172372 6041998 10302746 Recreational Socioeconomic total_recreational_catch_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1984 4566246 2615181 6517312 Recreational Socioeconomic total_recreational_catch_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1985 8973265 7073804 10872726 Recreational Socioeconomic total_recreational_catch_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1986 29444111 19979596 38908626 Recreational Socioeconomic total_recreational_catch_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
esp_landings <- create_total_mrip(bsb_landings$data,
  var_name = "landings"
)
## Removing data that does not meet MRIP standards. If you want to keep this data, set `remove_non_standard = FALSE`.
head(esp_landings) |>
  knitr::kable()
YEAR DATA_VALUE LOWER_95_CI UPPER_95_CI CATEGORY INDICATOR_TYPE INDICATOR_NAME INDICATOR_UNITS SPECIES REGION
1981 2387527 1250396 3524658 Recreational Socioeconomic total_recreational_landings_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1982 10696079 7299860 14092297 Recreational Socioeconomic total_recreational_landings_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1983 5075429 3434035 6716823 Recreational Socioeconomic total_recreational_landings_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1984 2447169 1329596 3564742 Recreational Socioeconomic total_recreational_landings_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1985 4491941 3268157 5715726 Recreational Socioeconomic total_recreational_landings_n n BLACK SEA BASS NORTH AND MID-ATLANTIC
1986 19254567 10763303 27745831 Recreational Socioeconomic total_recreational_landings_n n BLACK SEA BASS NORTH AND MID-ATLANTIC

Save data

If you would like to save the data, the save_catch function can be used to save the data and the query used as an Rds file. This function is useful for automating data pulls and saving them in a specified folder. The file names are automatically generated, and are printed when the function runs. The function returns the file name as a value, which can be used to read the data back in later.

save_catch(
  this_species = "black sea bass",
  this_region = "north and mid-atlantic",
  out_folder = here::here("inst/mrip_data"),
  catch_type = "all"
)
## Data saved at: C:/Users/stephanie.owen/Documents/READ-EDAB-NEesp2/inst/mrip_data/catch_all_black_sea_bass_north_and_mid-atlantic.Rds
## [1] "C:/Users/stephanie.owen/Documents/READ-EDAB-NEesp2/inst/mrip_data/catch_all_black_sea_bass_north_and_mid-atlantic.Rds"
save_catch(
  this_species = "black sea bass",
  this_region = "north and mid-atlantic",
  out_folder = here::here("inst/mrip_data"),
  catch_type = "landings"
)
## Data saved at: C:/Users/stephanie.owen/Documents/READ-EDAB-NEesp2/inst/mrip_data/catch_landings_black_sea_bass_north_and_mid-atlantic.Rds
## [1] "C:/Users/stephanie.owen/Documents/READ-EDAB-NEesp2/inst/mrip_data/catch_landings_black_sea_bass_north_and_mid-atlantic.Rds"

Plot data

The data can be plotted with plt_indicator() as long as it has columns named INDICATOR_NAME, DATA_VALUE, and YEAR.

plt_indicator(esp_catch)

plt_indicator(esp_landings)

Suggested workflow

We suggest using save_catch() to save the data, reading in the .Rds, and formatting using create_total_mrip() to format the data for use in ESPs. This allows for easy access to the data and metadata, and ensures that the data is in a consistent format for analysis.

save_data <- save_catch(
  this_species = "black sea bass",
  this_region = "north and mid-atlantic",
  out_folder = here::here(),
  catch_type = "all"
)

data <- readRDS(save_data)

esp_catch <- create_total_mrip(bsb_catch$data,
                               var_name = "catch")

This workflow can also be easily iterated over multiple species with purrr::map().

species_list <- c("black sea bass", "summer flounder", "scup")

purrr::map(
  species_list,
  ~ {
    save_data <- save_catch(
      this_species = .x,
      this_region = "north and mid-atlantic",
      out_folder = here::here(),
      catch_type = "all"
    )

    data <- readRDS(save_data)

    esp_catch <- create_total_mrip(data$data,
                                   var_name = "catch")

    write.csv(esp_catch, here::here(paste0("esp_catch_", .x, ".csv")))
  }
)

Black Sea Bass Total Recreational Trips

Recreational trip queries must be done by year (single query for each year). The earliest possible year is 1981. Additionally, each region must be queried separately (i.e. Mid-Atlantic and North Atlantic, or by state).

Simple queries

Here is a sample query for Black Sea Bass trips in the North Atlantic in 2020.

trips_2020 <- get_mrip_trips(species = "BLACK SEA BASS", region = "North Atlantic", year = "2020")
trips_2020
## $data
## # A tibble: 1 × 13
##   `Estimate Status`  Year `Fishing Year`                 Estimation Methodolog…¹
##   <chr>             <int> <chr>                          <chr>                  
## 1 FINAL              2020 Calendar Year (Jan 1 - Dec 31) MRIP (2020 - 2020)     
## # ℹ abbreviated name: ¹​`Estimation Methodology`
## # ℹ 9 more variables: `Cumulative Through` <chr>, PSE <dbl>,
## #   `Does Directed Trips Meet MRIP Standard` <chr>,
## #   `Is Directed Trips Significantly Different From 0` <chr>,
## #   `Directed Trips` <chr>, `Directed Trips Lower 95% Confidence Limit` <chr>,
## #   `Directed Trips Upper 95% Confidence Limit` <chr>, Species <fct>,
## #   Region <fct>
## 
## $metadata
## [1] " Your Query Parameters:   Query: MRIP EFFORT DIRECTED TRIP  Year: 2020 - 2020   Summarize By: ANNUAL  Fishing Year: CALENDAR YEAR (JANUARY 1 - DECEMBER 31)  Species: BLACK SEA BASS  Geographic Area: NORTH ATLANTIC  Fishing Mode: ALL MODES COMBINED  Fishing Area: ALL AREAS COMBINED  Species Option: PRIMARY TARGET, SECONDARY TARGET, CAUGHT (TYPE A), HARVESTED (TYPE B1), RELEASED (TYPE B2)  Information: DIRECTED ANGLER TRIPSNotes on Query Results:        MRIP does not support the use of estimates with a percent standard error above 50 and in those instances, recommends considering higher levels of aggregation (e.g., across states, geographic regions, or fishing modes).        Results from 1981-2017 contain estimates resulting from the full application of both the Access Point Angler Intercept Survey (APAIS) and Fishing Effort Survey (FES) calibration.        As of 2018 wave 1, all estimates of shore and private/rental boat fishing effort are now based on the FES.          MRIP estimates for Louisiana are not available after 2013. State produced estimates are available through the MRIP National Query. For more information on state run surveys and estimates, please click here.          Estimates for Hawaii (prior to 2023) and Puerto Rico (prior to 2014) are based on Marine Recreational Fisheries Statistics Survey methodology and have not been calibrated.          Beginning in 2023, estimates for Hawaii are produced using certified MRIP survey designs and weighted estimation methods.         Review the glossary for a description of how the for-hire survey methods have changed over time.                        \n Return to Query Page\n"

To build a time series, multiple queries need to be run. Trips could be manually downloaded and combined, as shown below. The following queries Black Sea Bass trips for the North Atlantic and Mid-Atlantic from 2020-2024.

trips_2020 <- get_mrip_trips(species = "BLACK SEA BASS", region = "North Atlantic", year = "2020")
trips_2021 <- get_mrip_trips(species = "BLACK SEA BASS", region = "North Atlantic", year = "2021")
trips_2022 <- get_mrip_trips(species = "BLACK SEA BASS", region = "North Atlantic", year = "2022")
trips_2023 <- get_mrip_trips(species = "BLACK SEA BASS", region = "North Atlantic", year = "2023")
trips_2024 <- get_mrip_trips(species = "BLACK SEA BASS", region = "North Atlantic", year = "2024")

trips2_2020 <- get_mrip_trips(species = "BLACK SEA BASS", region = "Mid-Atlantic", year = "2020")
trips2_2021 <- get_mrip_trips(species = "BLACK SEA BASS", region = "Mid-Atlantic", year = "2021")
trips2_2022 <- get_mrip_trips(species = "BLACK SEA BASS", region = "Mid-Atlantic", year = "2022")
trips2_2023 <- get_mrip_trips(species = "BLACK SEA BASS", region = "Mid-Atlantic", year = "2023")
trips2_2024 <- get_mrip_trips(species = "BLACK SEA BASS", region = "Mid-Atlantic", year = "2024")
n_trips <- rbind(
  trips_2020$data,
  trips_2021$data,
  trips_2022$data,
  trips_2023$data,
  trips_2024$data
)

mid_trips <- rbind(
  trips2_2020$data,
  trips2_2021$data,
  trips2_2022$data,
  trips2_2023$data,
  trips2_2024$data
)

head(n_trips)
## # A tibble: 5 × 13
##   `Estimate Status`  Year `Fishing Year`                 Estimation Methodolog…¹
##   <chr>             <int> <chr>                          <chr>                  
## 1 FINAL              2020 Calendar Year (Jan 1 - Dec 31) MRIP (2020 - 2020)     
## 2 FINAL              2021 Calendar Year (Jan 1 - Dec 31) MRIP (2021 - 2021)     
## 3 FINAL              2022 Calendar Year (Jan 1 - Dec 31) MRIP (2022 - 2022)     
## 4 FINAL              2023 Calendar Year (Jan 1 - Dec 31) MRIP (2023 - 2023)     
## 5 FINAL              2024 Calendar Year (Jan 1 - Dec 31) MRIP (2024 - 2024)     
## # ℹ abbreviated name: ¹​`Estimation Methodology`
## # ℹ 9 more variables: `Cumulative Through` <chr>, PSE <dbl>,
## #   `Does Directed Trips Meet MRIP Standard` <chr>,
## #   `Is Directed Trips Significantly Different From 0` <chr>,
## #   `Directed Trips` <chr>, `Directed Trips Lower 95% Confidence Limit` <chr>,
## #   `Directed Trips Upper 95% Confidence Limit` <chr>, Species <fct>,
## #   Region <fct>

Save data

To make the data download more reproducible and efficient, there is a save_trips() function that can be iterated on with purrr::map(). This function executes the MRIP query and saves the .Rds with the MRIP data download and query information in the specified folder. Data can then be read in and used in analyses. For example, the following code will download and save the same data that is shown in the trips_2020 object above. The file name is automatically created and is returned by the function.

save_trips(
  this_species = "BLACK SEA BASS",
  this_year = 2020,
  this_region = "North Atlantic",
  out_folder = here::here("inst/mrip_data")
)
## MRIP query successful: BLACK SEA BASS North Atlantic 2020
## Data saved at: C:/Users/stephanie.owen/Documents/READ-EDAB-NEesp2/inst/mrip_data/BLACK_SEA_BASS_trips/trips_BLACK_SEA_BASS_North_Atlantic_2020.Rds
## [1] "C:/Users/stephanie.owen/Documents/READ-EDAB-NEesp2/inst/mrip_data/BLACK_SEA_BASS_trips/trips_BLACK_SEA_BASS_North_Atlantic_2020.Rds"

Automate data pulls with save_trips()

To iterate with purrr::map():

# create parameter grid
params <- expand.grid(
  region = c("north atlantic", "mid-atlantic"),
  year = c(2020:2024),
  species = "Black sea bass"
)

# iterate
purrr::map(
  purrr::list_transpose(list(
    region = params$region,
    year = params$year,
    species = params$species
  )),
  ~ try(NEesp2::save_trips(
    this_species = .x$species,
    this_year = .x$year,
    this_region = .x$region,
    out_folder = here::here()
  ))
)

Please note that iterating over a large number of species and years may fail. Since data is saved as it is queried, progress will be saved and can be resumed by adjusting params running the function again.

Wrangle data

After the MRIP trip data has been saved, it can be easily turned into a data frame using the create_mrip_trips function. This function takes a single argument, which is the list of files to be combined. Note that this function will automatically combine the data from multiple regions, so if you would like to create region-specific indicators, you must run the function over two separate lists of files.

esp_trips <- create_mrip_trips(
  files = list.files(system.file("mrip_data", package = "NEesp2"),
    pattern = "trips_Black_sea_bass*",
    recursive = TRUE,
    full.names = TRUE
  )
)

esp_trips |>
  knitr::kable()
YEAR DATA_VALUE CATEGORY INDICATOR_TYPE INDICATOR_NAME INDICATOR_UNITS SPECIES
2020 6750639 Recreational Socioeconomic rec_trips number Black sea bass
2021 6840012 Recreational Socioeconomic rec_trips number Black sea bass
2022 7528515 Recreational Socioeconomic rec_trips number Black sea bass
2023 6915482 Recreational Socioeconomic rec_trips number Black sea bass
2024 5947798 Recreational Socioeconomic rec_trips number Black sea bass

Plot data

plt_indicator(esp_trips)
## N < 30