zip.plot {muRL} | 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("data", "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 ', such as the output of read.murl . |
zip.file |
a character string naming a .tab file with the columns for the latitude and longitude of ZIP codes, such as 'zips.tab ' provided in the murl package (the default). |
map.type |
the type of map for map() from the maps library to create. See Details for more. |
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 map() from the maps library to use. |
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() from the maps library. See Details below for more. |
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@wustl.edu and Andrew Reeves areeves@bu.edu
## Call murl object of sample addresses data(murljobs) zip.plot(murljobs) ## Read .csv to murl object murljobs <- read.murl(system.file("data", "murljobs.csv", package = "muRL")) ## Specify US state to map zip.plot(murljobs, map.type = "state", region = "maryland")