Remove inactive sites from downloaded FRS data.table
Source:R/frs_drop_inactive.R
frs_drop_inactive.Rd
Remove inactive sites from downloaded FRS data.table
Arguments
- frs
Required, data.table from frs_get()
- closedid
Required, vector of codes to treat as inactive, obtained from
frs_inactive_ids()
which downloads national dataset and uses assumed codes and returns ids of the inactive sites.
Details
For the late 2023 version,
Complete list of unique ids is 4,775,797 out of 7,558,760 rows of data.
Count of all REGISTRY_ID rows: 7,558,760
Count of unique REGISTRY_ID values: 4,775,797
Clearly inactive unique IDs: 1,511,111
Assumed active unique IDs: 3,264,686
The definitions of active/inactive here are not quite the same as used in ECHO, as of late 2023.
See https://echo.epa.gov/help/facility-search/search-criteria-help#facchar
Codes assumed to mean site is closed:
CLOSED
PERMANENTLY CLOSED
PERMANENTLY SHUTDOWN
INACTIVE
TERMINATED
N
RETIRED
OUT OF SERVICE – WILL NOT BE RETURNED
CANCELED, POSTPONED, OR NO LONGER PLANNED
See also
frs_update_datasets()
which uses frs_get()
and frs_inactive_ids()
frs_active_ids()