flatten.geo.set: Convenience function to "flatten" a nested geo.set object.

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1

Arguments

x

the geo.set to be flattened

Value

Returns a new geo.set object.

Author(s)

Ezra Haber Glenn eglenn@mit.edu

See Also

geo.set-class

Examples

 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)

acs documentation built on May 1, 2019, 8:41 p.m.