Filters a dataframe to marine fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a fishery_id
column name.
filter_marine.Rd
Filters a dataframe to marine fisheries. Will
automatically detect whether it's working with a Chinook or Coho
dataset if the tables were generated within this package. Requires
a fishery_id
column name.
Arguments
- .data
Dataframe containing
fishery_id
column. Commonly, output fromframrsquared::fetch_table()
.- species
Optional argument to identify species if
.data
doesn't already. If provided, must be "COHO" or "CHINOOK". Defaults toNULL
Examples
if (FALSE) { # \dontrun{
fram_dataframe |> filter_marine()
} # }
framrosetta::fishery_chinook_fram |> filter_marine(species = "CHINOOK")
#> # A tibble: 71 × 5
#> species version_number fishery_id fishery_name fishery_title
#> <chr> <int> <int> <chr> <chr>
#> 1 CHINOOK 1 55 Tr 6B:9Net Tr Area 6B:9 Net
#> 2 CHINOOK 1 56 A 10 Sport NT Area 10 Sport
#> 3 CHINOOK 1 57 A 11 Sport NT Area 11 Sport
#> 4 CHINOOK 1 58 NT10:11Net NT Area 10:11 Net
#> 5 CHINOOK 1 59 Tr10:11Net Tr Area 10:11 Net
#> 6 CHINOOK 1 60 A 10A Sprt NT Area 10A Sport
#> 7 CHINOOK 1 61 Tr 10A Net Tr Area 10A Net
#> 8 CHINOOK 1 62 A 10E Sprt NT Area 10E Sport
#> 9 CHINOOK 1 63 Tr 10E Net Tr Area 10E Net
#> 10 CHINOOK 1 64 A 12 Sport NT Area 12 Sport
#> # ℹ 61 more rows
framrosetta::fishery_coho_fram |> filter_marine(species = "COHO")
#> # A tibble: 115 × 5
#> species version_number fishery_id fishery_name fishery_title
#> <chr> <int> <int> <chr> <chr>
#> 1 COHO 1 3 Ft Brg Spt Fort Bragg Sport
#> 2 COHO 1 4 Ft Brg Trl Fort Bragg Troll
#> 3 COHO 1 5 Ca KMZ Spt KMZ Sport
#> 4 COHO 1 6 Ca KMZ Trl KMZ Troll
#> 5 COHO 1 7 So Cal Spt So Calif. Sport
#> 6 COHO 1 8 So Cal Trl So Calif. Troll
#> 7 COHO 1 15 Brkngs Spt Brookings Sport
#> 8 COHO 1 16 Brkngs Trl Brookings Troll
#> 9 COHO 1 17 Newprt Spt Newport Sport
#> 10 COHO 1 18 Newprt Trl Newport Troll
#> # ℹ 105 more rows