Filters a dataframe to California 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_ca.Rd
Filters a dataframe to California 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_ca()
} # }
framrosetta::fishery_chinook_fram |> filter_ca(species = "CHINOOK")
#> # A tibble: 3 × 5
#> species version_number fishery_id fishery_name fishery_title
#> <chr> <int> <int> <chr> <chr>
#> 1 CHINOOK 1 32 KMZ Troll KMZ Troll
#> 2 CHINOOK 1 33 KMZ Sport KMZ Sport
#> 3 CHINOOK 1 34 So Cal Trl So Calif. Troll
framrosetta::fishery_coho_fram |> filter_ca(species = "COHO")
#> # A tibble: 8 × 5
#> species version_number fishery_id fishery_name fishery_title
#> <chr> <int> <int> <chr> <chr>
#> 1 COHO 1 1 No Cal Trm No Calif Cst Terminal Catch
#> 2 COHO 1 2 Cn Cal Trm Cntrl Cal Cst Term Catch
#> 3 COHO 1 3 Ft Brg Spt Fort Bragg Sport
#> 4 COHO 1 4 Ft Brg Trl Fort Bragg Troll
#> 5 COHO 1 5 Ca KMZ Spt KMZ Sport
#> 6 COHO 1 6 Ca KMZ Trl KMZ Troll
#> 7 COHO 1 7 So Cal Spt So Calif. Sport
#> 8 COHO 1 8 So Cal Trl So Calif. Troll