Description Usage Arguments Details Value Author(s) See Also Examples
When working with the acs package and the acs.fetch
and
geo.make
functions, it can be difficult to find exactly the right
geographic units: geo.make
expects single matches to the groups
of arguments it is given, which can be problematic when trying to find
names for places or county subdivisions, which are unfamiliar to many
users (and often seem very close or redundant: e.g., knowing whether to
look for "Moses Lake city" vs. "Moses Lake CDP"). To help, the
geo.lookup
function will search on the same arguments as
geo.make
, but outputs all the matches for your inspection.
1 2 3 | geo.lookup(state, county, county.subdivision, place,
american.indian.area, school.district, school.district.elementary,
school.district.secondary, school.district.unified)
|
state |
either the two-digit numeric FIPS code for the state, the two-letter postal abbreviation, or a character string to match in the state name |
county |
either the numeric FIPS code for the county or a character string to match in the county name |
county.subdivision |
either the numeric FIPS code for the county subdivision or a character string to match in the county subdivision name |
place |
either the numeric FIPS code for the place or a character string to match in the place name |
american.indian.area |
either the numeric FIPS code for the American Indian Area/Alaska Native Area/Hawaiian Home Land, or a character string to match in the names of these Census areas |
school.district |
either the numeric FIPS code for the state school district (any type), or a character string to search for in the names of the school districts. |
school.district.elementary |
either the numeric FIPS code for the state school district (elementary), or a character string to search for in the names of these elementary school districts. |
school.district.secondary |
either the numeric FIPS code for the state school district (secondary), or a character string to search for in the names of these secondary school districts. |
school.district.unified |
either the numeric FIPS code for the state school district (unified), or a character string to search for in the names of these unified school districts. |
Unlike geo.make
, geo.lookup
searches for
matches anywhere in geographic names (except when dealing with state
names), and will output a dataframe showing candidates that match some
or all of the arguments. (When multiple arguments are provided, the
logic is a little complicated: basically, with the exception of American
Indian Areas, to be included all geographies must match the given state
name; when a county and a subdivision are both given, both must match;
otherwise, geographies are included that match any — but not
necessarily all — of the other arguments.)
Returns a dataframe of the matching geographies, with one column for each of the given search terms.
Ezra Haber Glenn eglenn@mit.edu
1 2 3 4 5 6 7 8 9 10 11 | geo.lookup(state="WA", county="Ska", county.subdivision="oo")
geo.lookup(state="WA", county="Kit", place="Ra")
# find all counties in WA or OR with capital M or B in name
geo.lookup(state=c("WA", "OR"), county=c("M","B"))
# find all unified school districts in Kansas with "Ma" in name
geo.lookup(state="KS", school.district.unified="Ma")
# find all american indian areas with "Hop" in name
geo.lookup(american.indian.area="Hop")
|
Loading required package: stringr
Loading required package: XML
Attaching package: 'acs'
The following object is masked from 'package:base':
apply
state state.name county county.name county.subdivision
1 53 Washington NA <NA> NA
2 53 Washington 57 Skagit County NA
3 53 Washington 59 Skamania County NA
4 53 Washington 57 Skagit County 92944
5 53 Washington 59 Skamania County 90424
county.subdivision.name
1 <NA>
2 <NA>
3 <NA>
4 Sedro-Woolley CCD
5 Carson-Underwood CCD
state state.name county county.name place place.name
1 53 Washington NA <NA> NA <NA>
2 53 Washington 35 Kitsap County NA <NA>
3 53 Washington 37 Kittitas County NA <NA>
4 53 Washington NA Pierce County 57140 Raft Island CDP
5 53 Washington NA Thurston County 57220 Rainier city
6 53 Washington NA King County 57395 Ravensdale CDP
7 53 Washington NA Pacific County 57430 Raymond city
state state.name county county.name
1 53 Washington NA <NA>
2 53 Washington 5 Benton County
3 53 Washington 45 Mason County
4 41 Oregon NA <NA>
5 41 Oregon 1 Baker County
6 41 Oregon 3 Benton County
7 41 Oregon 45 Malheur County
8 41 Oregon 47 Marion County
9 41 Oregon 49 Morrow County
10 41 Oregon 51 Multnomah County
state state.name school.district.unified
1 20 Kansas NA
2 20 Kansas 16
3 20 Kansas 9060
4 20 Kansas 9090
5 20 Kansas 9140
6 20 Kansas 9180
7 20 Kansas 9240
8 20 Kansas 9480
9 20 Kansas 9660
school.district.unified.name
1 <NA>
2 Marysville Unified School District 364
3 Macksville Unified School District 351
4 Madison-Virgil Unified School District 386
5 Maize Unified School District 266
6 Manhattan Unified School District 383
7 Marion-Florence Unified School District 408
8 Marais des Cygnes Valley Unified School District 456
9 Marmaton Valley Unified School District 256
school.district.unified.type
1 <NA>
2 Unified
3 Unified
4 Unified
5 Unified
6 Unified
7 Unified
8 Unified
9 Unified
american.indian.area american.indian.area.name
1 1505 Hopi Reservation and Off-Reservation Trust Land
2 1515 Hopland Rancheria and Off-Reservation Trust Land
3 7250 Point Hope ANVSA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.