get_species_locations | R Documentation |
This is a convenience function to list all available locations for a given species. By default, a data frame is returned with available countries, states and flyways
get_species_locations( df, species_code, type = c("country", "state", "flyway"), db_types = c("b", "r"), columns = NULL, sort_by = NULL, return_names = TRUE, return_codes = TRUE ) get_species_countries(df, species_code, ...) get_species_states(df, species_code, ...) get_species_flyways(df, species_code, ...)
df |
The dataframe in which to search |
species_code |
The 4 letters short code for the desired species (as found in the SPEC column of the gb_banding dataset) |
type |
The type of data desired. Can be one of "country", "state" or "flyway", Default: c("country", "state", "flyway") |
columns |
The desired columns. By default returns all the location related columns: "country_name", "state_name" and "flyway" |
sort_by |
Column by which the results are sorted. Default: NULL, the results are unsorted |
return_names |
Return the name values of the desired columns? Default: TRUE |
return_codes |
Return the code values for the desired columns? Default: TRUE |
db_type |
The type of data desired, banding or recovery. Can take any
value accepted by |
return_names and return_code will add the appropriate columns
from the dataset. For example, if type is country
, and return_names is
set to TRUE
, the function will return the column country_name if it is
not already present in columns.
If columns contains more than one element, a data frame with all available combinations of the selected columns. If columns contains only one element, a sorted vector of the unique values of the selected column
get_species_countries
: Convenience functions to list
all available countries for the given species.
get_species_states
: Convenience functions to list
all available states for the given species.
get_species_flyways
: Convenience functions to list
all available countries for the given species.
get_species_location("ATBR") get_species_location("ATBR", "country_name") # is equivalent to: get_species_countries("ATBR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.