geo.set-class {acs}R Documentation

Class "geo.set"

Description

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 from the Class

Objects can be created by calls of the form new("geo.set", ...), or more frequently through the geo.make() helper function.

Slots

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.

Methods

[

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

c

signature(x = "geo.set"): combine two or more geo.set objects, preserving the structure of each – allows nesting

combine<-

signature(object = "geo.set"): used to set or change value of combine

combine

signature(object = "geo.set"): returns logical value of combine

combine.term<-

signature(object = "geo.set"): used to set or change combine.term

combine.term

signature(object = "geo.set"): returns combine.term

geo.list

signature(object = "geo.set"): returns the geo.list of the geo.set (used internally)

length

signature(x = "geo.set"): returns an integer indicating how many geographies it contains; non-recursive.

name

signature(object = "geo"): returns the text name of an individual geo object.

sumlev

signature(object = "geo"): returns the summary level of an individual geo object.

Author(s)

Ezra Haber Glenn eglenn@mit.edu

References

http://eglenn.scripts.mit.edu/citystate/category/code/

See Also

geo.make

Examples

showClass("geo.set")

[Package acs version 2.1.4 Index]