map(database, regions) # simple form
map(database="state", regions=".", xlim=, ylim=, boundary=T, interior=T,
fill=F, color=1, projection=, parameters=, orientation=,
resolution=1, type="l", plot=T, add=F, namesonly=F)
- database:
-
character string naming the geographical database from which map
is to get its information.
Currently the choices may include a "world" map along with
four USA databases: "usa" for national boundaries,
"state" for state boundaries and "county" for county
boundaries and a simplified "state.vbm" map.
Detailed documentation for
Usa, State, County, State.vbm, and World (the database names with
initial capitals) gives more information on the databases.
- regions:
-
character vector that names the polygons to draw.
Each database is composed of a collection of polygons, and each polygon has
a unique name.
When a region is composed of more than one polygon, the individual polygons
have the name of the region, followed by a colon and a qualifier,
as in michigan:north and michigan:south.
Each element of the regions argument is matched as a regular expression
against all the polygon names in the database and matches are selected
for drawing (but see xlim, ylim and color=, each of which
can potentially modify this list).
The default selects all polygons in the database.
- xlim:
-
two element numeric
vector giving a range of longitudes, expressed
in degreees, to which drawing
should be restricted.
Longitude is measured in degrees east of Greenwich, so that, in particular,
locations in the USA have negative longitude.
If fill=TRUE, polygons selected by region must be entirely inside
the xlim range.
The default value of this argument spans the entire longitude range
of the database.
- ylim:
-
two element
numeric vector giving a range of latitudes,
expressed in degrees, to which drawing
should be restricted.
Latitude is measured in degrees north of the
equator, so that, in particular,
locations in the USA have positive latitude.
If fill=TRUE, polygons selected by region must be entirely inside
the ylim rang
The default value of this argument spans the entire latitude range
of the database.
- boundary:
-
logical flag that says whether to draw boundary segments.
A boundary segment is a line segment of the map that bounds only
one of the polygons to be drawn.
This argument is ignored if fill is TRUE.
- interior:
-
logical flag that says whether to draw interior segments.
An interior segment is a line segment of the map that bounds two
of the polygons to be drawn.
This argument is ignored if fill is TRUE.
- fill:
-
logical flag that says whether to draw lines or fill areas.
If FALSE, the lines bounding each region will be drawn (but
only once, for interior lines).
If TRUE, each region will be filled using colors from the color=
argument, and
bounding lines will not be drawn.
- color:
-
vector of colors.
If fill is FALSE, the first color is used for plotting
all lines, and any other colors are ignored.
Otherwise, the colors are matched one-one with the polygons
that get selected by the region argument (and are reused
cyclically, if necessary).
A color of NA causes the corresponding region to be deleted
from the list of polygons to be drawn.
Polygon colors are assigned after polygons are deleted due to values
of the xlim and ylim arguments.
- projection:
-
character string that names a map projection to
use.
See Appendix C of the
Reference for a description of this and the
next two arguments.
The default is to use a
rectangular projection with the aspect ratio
chosen so that longitude and latitude scales are equivalent
at the center of the picture.
- parameters:
-
numeric vector of parameters for use with the
projection argument.
This argument is optional only in the sense that certain
projections do not require additional parameters.
If a projection does require additional parameters, these
must be given in the parameters argument.
See Appendix C of the Reference for details.
- orientation:
-
up to three numbers specifying the orientation of
non-standard projections.
Default is c(90,0,m), where m is the middle of the longitude range.
See Appendix C of Reference for details.
- resolution:
-
number that specifies the resolution with which
to draw the map.
Resolution 0 is the full resolution of the database.
Otherwise, just before polylines are plotted they are thinned:
roughly speaking, successive points on the polyline that are
within resolution device pixels of one another are collapsed
to a single point (see the Reference for further details).
- type:
-
character string that controls drawing of the map.
Aside from the default type="l", the value type="n" can be used
to set up the coordinate system and projection for a map that will
be added-to in later calls.
- plot:
-
logical flag that specifies whether plotting
should be done.
If plot is TRUE the return value of map will
not be printed automatically .
- add:
-
logical flag that specifies whether to add to the
current plot.
If FALSE, a new plot is begun, and a new coordinate
system is set up.
- namesonly:
-
logical flag that says whether just the names of selected polygons
will be returned as a character vector.
If FALSE, map coordinates are returned.
Graphical parameters may also be supplied as arguments
to this function (see par).