zip.plot | R Documentation |
Using United States ZIP codes, plots on a map the location of letter recipients. State or county boundaries may be displayed.
zip.plot(data, zip.file = system.file("extdata", "zips.tab", package =
"muRL"), map.type = "state", cex = 1, col = "black", pch = 20,
jitter.factor = NULL, ...)
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 |
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.
zip.plot
calls the map
function in the maps
package. The map
function places an object called stateMapEnv
in the user's workspace.
Ryan T. Moore rtm@american.edu and Andrew Reeves reeves@wustl.edu
read.murl
, zips
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.