Description Objects from the Class Slots Methods Author(s) References See Also Examples
The geo.set class provides a convenient wrapper for user-defined geographies, used for downloading data from the U.S. Census American Community Survey. A geo.set may hold the designation of a single geography (say, a census tract, a county, or a state), or may bundle together multiple geographies of various levels, which may or may not be "combined" when downloaded. Note that geo.sets may even contain nested geo.sets.
Note: even a single geographic unit — one specific tract or county — must be wrapped up as a geo.set. Technically, each individual element in the set is known as a "geo", but users will rarely (if ever) interact will individual elements such as this; wrapping all groups of geographies — even groups consisting of just one element — in geo.sets like this will help make them easier to deal with as the geographies get more complex.
geo.set objects may be combined with the simple addition operator
(+
). By default, this will always return "flat" geo.sets with
all the geographies in a single list. The combination operator
(c
), on the other hand, will generally return nested hierarchies,
embedding sets within sets. When working with nested sets like this,
the "combine" flag can be set at each level to aggregate subsets within
the structure (although be careful — if a higher level of set includes
"combine=T" you'll never actually see the unaggregated subsets deeper
down).
Using these different techniques, users are able to create whatever sort of new geographies they need — aggregating some geographies, keeping others distinct (but still bundled as a set for convenience), mixing and matching different levels of Census geography, and so on.
Objects can be created by calls of the form new("geo.set", ...)
,
or more frequently through the geo.make()
helper function.
geo.list
:Object of class "list"
containing individual census geographies (as geo class
object) and/or geo.sets.
combine
:Object of class "logical"
indicating
whether or not data from the constituent geographies should be
combined when downloaded. Set with combine<-
or specified
when using geo.make
.
combine.term
:Object of class "character"
indicating a new label to use when data is combined; ignored when
combine set to F. Set with combine.term<-
or specified
when using geo.make
.
signature(x = "geo.set")
: subset geo.set, similar to
single-bracket list subsetting in R
signature(x = "geo.set")
: subset geo.set, similar to
double-bracket list subsetting in R
signature(e1 = "geo", e2 = "geo")
: combine two geo
objects; returns a geo.set (generally reserved for internal use)
signature(e1 = "geo", e2 = "geo.set")
: combine a geo object
onto an existing geo.set; returns a geo.set (generally reserved for internal use)
signature(e1 = "geo.set", e2 = "geo")
: combine an
existing geo.set object with a geo object; returns a geo.set (generally reserved for internal use)
signature(e1 = "geo.set", e2 = "geo.set")
: combine
two geo.set objects; always flattens each set – no nesting
signature(x = "geo.set")
: combine two or more
geo.set objects, preserving the structure of each – allows nesting
signature(object = "geo.set")
: used to
set or change value of combine
signature(object = "geo.set")
: returns logical
value of combine
signature(object = "geo.set")
: used to
set or change combine.term
signature(object = "geo.set")
: returns combine.term
signature(object = "geo.set")
: returns the
geo.list of the geo.set (used internally)
signature(x = "geo.set")
: returns an integer
indicating how many geographies it contains; non-recursive.
signature(object = "geo")
: returns the text name
of an individual geo object.
signature(object = "geo")
: returns the summary
level of an individual geo object.
Ezra Haber Glenn eglenn@mit.edu
http://eglenn.scripts.mit.edu/citystate/category/code/
1 | showClass("geo.set")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.