Find all blocks within each of the FIPS codes provided
Source:R/getblocksnearby_from_fips.R
getblocksnearby_from_fips.Rd
Allows EJAM to analyze and compare Counties, for example
Arguments
- fips
vector of FIPS codes identifying blockgroups, tracts, counties, or states. This is useful if – instead of gettings stats on and comparing circular buffers or polygons – one will be getting stats on one or more tracts, or analyzing and comparing blockgroups in a county, or comparing whole counties to each other, within a State.
- inshiny
used by shiny app server code to handle errors via validate() instead of stop()
- need_blockwt
set to FALSE to speed it up if you do not need blockwt
Value
same as for getblocksnearby but one row per FIPS, and the distance column is irrelevant
See also
getblocksnearby()
fips_bgs_in_fips()
fips_lead_zero()
getblocksnearby_from_fips()
fips_from_table()
Examples
x <- getblocksnearby_from_fips(fips_counties_from_state_abbrev("DE"))
#> Joining with `by = join_by(blockid)`
counties_ej <- doaggregate(x)
#> *** For now, if sites2states_or_latlon is not provided to doaggregate(),
#> for circles covering 2 states, it will use state of nearest block,
#> and for Shapefiles spanning 2 States, will just use 1 of the States -
#> not selected by area or population, but just whatever happens to be first in the table.
#> This should only arise if not in shiny app and not using ejamit() and
#> sites2states_or_latlon was not provided to doaggregate()
#cannot use mapfast(counties_ej$results_bysite) since no lat lon. mapfastej_counties() should work...
y = ejamit(fips=fips_counties_from_statename("Delaware"))
#> Finding blocks in each FIPS Census unit.
#> Joining with `by = join_by(blockid)`
#> Aggregating at each FIPS Census unit and overall.
# x=getblocksnearby_from_fips("482011000011") # one blockgroup only
# y=doaggregate(x)