Description Usage Arguments Value Author(s) See Also Examples
In the acs package, geo.set objects may contain nested levels of geo.set objects, which is often desired (to organize complex sets and subsets of geography). Sometimes, however, when combining these sets, users may prefer to remove the nesting levels. This convenience function will recursively prowl through a geo.set and return a single flat geo.set (one level deep) containing of the composite geographies.
1 |
x |
the geo.set to be flattened |
Returns a new geo.set object.
Ezra Haber Glenn eglenn@mit.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # a multiple-county geo.set
psrc=geo.make(state="WA", county=c(33,35,53,61))
# combine geo.sets
north.mercer.island=geo.make(state=53, county=33, tract=c(24300,24400))
optional.tract=geo.make(state=53, county=33, tract=24500)
# add in one more tract to create new, larger geo
north.mercer.island.plus=north.mercer.island + optional.tract
# created a nested geo.set
my.nested.geo.set=c(north.mercer.island.plus, psrc)
str(my.nested.geo.set)
length(my.nested.geo.set)
# .. and flatten in out
# note difference in structure and length
my.flat.geo.set=flatten.geo.set(my.nested.geo.set)
str(my.flat.geo.set)
length(my.flat.geo.set)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.