zip.plot {muRL} | R Documentation |
Plot US ZIP codes, including locations of letter recipients.
Description
Using United States ZIP codes, plots on a map the location of letter recipients. State or county boundaries may be displayed.
Usage
zip.plot(data, zip.file = system.file("extdata", "zips.tab", package =
"muRL"), map.type = "state", cex = 1, col = "black", pch = 20,
jitter.factor = NULL, ...)
Arguments
data |
a dataframe with ZIP codes in a column named ' |
zip.file |
a character string naming a |
map.type |
the type of map for |
cex |
a numerical value giving the amount by which plotting text and symbols should be magnified relative to the default. Accepts, for example, a vector of values which are recycled. |
col |
a specification for the plotting color. |
pch |
the plotting character for |
jitter.factor |
a numeric specifying by how much points should be jittered before plotting. See Details below for more. |
... |
other arguments to pass to |
Details
map.type
can be any valid map from the maps
package. For plotting the location of United States ZIP codes, usa
, state
, or county
should be used.
See help(par)
for more details on cex
, col
, and pch
.
See help(jitter)
for more details on jitter.factor
. zip.plot
jitters latitude and longitude separately using the same factor.
To plot only a region within the selected map.type
, include the map
argument region =
. For example, zip.plot(..., region = ``Maryland'')
would plot only the recipients with ZIP codes in the US state of Maryland.
Note
zip.plot
calls the map
function in the maps
package. The map
function places an object called stateMapEnv
in the user's workspace.
Author(s)
Ryan T. Moore rtm@american.edu and Andrew Reeves reeves@wustl.edu
See Also
Examples
## Call murl object of sample addresses
data(murljobs)
zip.plot(murljobs)
## Read .csv to murl object
murljobs <- read.murl(system.file("extdata", "murljobs.csv", package = "muRL"))
## Specify US state to map
zip.plot(murljobs, map.type = "state", region = "maryland")