Find EPA-regulated facilities in FRS by SIC code (industrial category)
Source:R/sic_xyz.R
latlon_from_sic.Rd
Get lat lon, Registry ID, given SIC industry code(s) Find all EPA Facility Registry Service (FRS) sites with this exact SIC code (not subcategories)
Arguments
- sic
a vector of SIC codes, or a data.table with column named code, as with output of
sic_from_any()
- id_only
logical optional, set TRUE to get only the vector of REGISTRY_ID values back instead of a data.frame with lat,lon,SIC columns too.
Value
A data.table (not just data.frame) with columns called lat, lon, REGISTRY_ID, SIC (unless the id_only parameter is set to TRUE)
Details
The EPA also provides a FRS Facility Industrial Classification Search tool where you can find facilities based on NAICS or SIC.
NOTE: many FRS sites lack SIC code!
Also, this function does not find the sites identified by FRS data as being in a child SIC (subcategory of your exact query)!
Relies on frs_by_sic (a data.table)
See info about SIC industry codes at https://www.naics.com/search
Examples
regid_from_sic('7300')
#> Key: <SIC, REGISTRY_ID>
#> lat lon REGISTRY_ID SIC
#> <num> <num> <char> <char>
#> 1: 34.22987 -118.55510 110002900736 7300
#> 2: 41.08589 -74.33128 110004267800 7300
#> 3: 42.54940 -114.47859 110010752550 7300
#> 4: 34.01392 -118.19359 110011611648 7300
#> 5: 38.68731 -90.39718 110024449658 7300
#> 6: 40.73294 -74.06308 110030543437 7300
#> 7: 41.04292 -74.07526 110031793806 7300
#> 8: 40.40642 -74.66741 110032477861 7300
#> 9: 39.83567 -75.21408 110040259485 7300
#> 10: 34.06951 -118.34760 110065446244 7300
#> 11: 34.08792 -118.34194 110065723667 7300
#> 12: 34.27237 -118.42343 110065865282 7300
#> 13: 34.25945 -118.43181 110066299856 7300
#> 14: 34.10202 -118.32319 110066397241 7300
#> 15: 33.79480 -118.24245 110066691048 7300
#> 16: 33.99711 -118.30928 110066717627 7300
latlon_from_sic('7300')
#> Key: <SIC, REGISTRY_ID>
#> lat lon REGISTRY_ID SIC
#> <num> <num> <char> <char>
#> 1: 34.22987 -118.55510 110002900736 7300
#> 2: 41.08589 -74.33128 110004267800 7300
#> 3: 42.54940 -114.47859 110010752550 7300
#> 4: 34.01392 -118.19359 110011611648 7300
#> 5: 38.68731 -90.39718 110024449658 7300
#> 6: 40.73294 -74.06308 110030543437 7300
#> 7: 41.04292 -74.07526 110031793806 7300
#> 8: 40.40642 -74.66741 110032477861 7300
#> 9: 39.83567 -75.21408 110040259485 7300
#> 10: 34.06951 -118.34760 110065446244 7300
#> 11: 34.08792 -118.34194 110065723667 7300
#> 12: 34.27237 -118.42343 110065865282 7300
#> 13: 34.25945 -118.43181 110066299856 7300
#> 14: 34.10202 -118.32319 110066397241 7300
#> 15: 33.79480 -118.24245 110066691048 7300
#> 16: 33.99711 -118.30928 110066717627 7300
latlon_from_sic(sic_from_any("cheese")[,code] )
#> Key: <SIC, REGISTRY_ID>
#> lat lon REGISTRY_ID SIC
#> <num> <num> <char> <char>
#> 1: 44.19644 -75.95834 110000326102 2022
#> 2: 42.87593 -78.86949 110000326825 2022
#> 3: 42.83404 -78.82388 110000327183 2022
#> 4: 41.47924 -81.07851 110000385798 2022
#> 5: 43.59796 -85.14557 110000410207 2022
#> ---
#> 371: 44.75453 -90.29649 110071498797 2022
#> 372: 40.06665 -77.51666 110071723361 2022
#> 373: 38.15922 -122.66852 110071756914 2022
#> 374: 41.75465 -124.20383 110071769744 2022
#> 375: 37.26021 -120.99724 110071799425 2022
head(latlon_from_sic(c('6150', '6300', '5995'), id_only=TRUE))
#> [1] "110000346545" "110000524200" "110000528616" "110001362427" "110002218546"
#> [6] "110007563252"
# mapfast(frs_from_sic('6150')) # simple map