Get data on ESA action petitions
get_petitions_table(tsn = NULL)
A data_frame with 11 variables:
ECOS provides a 'slot' for a table of petitions for species, but
that table is javascript-generated. Interestingly, we can get the raw data
using a GET call. The request is keyed to the species TSN, which
is the key used by ITIS, not the `Species Code` that FWS uses for most other
identifiers. The default tsn = NULL
will get all of the petition data,
but there is no reliable key to link petitions to species.
The structure of the returned data_frame could be improved to expand the variables that are stored as strings of semicolon-delimited lists, but at the cost of substantially larger (and perhaps more confusing) dfs.
## Not run: ------------------------------------ # url <- "https://ecos.fws.gov/ecp0/profile/speciesProfile?spcode=A001" # pet <- get_species_tsn(url) %>% get_petitions_table() # # or # pet <- get_species_url("Myotis sodalis") %>% # get_species_tsn() %>% # get_petitions_table() ## ---------------------------------------------