United States Coastline and State Boundaries

DESCRIPTION:

Puts all or part of the United States on the current or a new plot, with or without state boundaries.

USAGE:

usa(states=T, coast=T, add=F, xlim=c(-130,-65), ylim=c(24,50), fifty=F)

OPTIONAL ARGUMENTS:

states
logical flag to control whether state boundaries are plotted.
coast
logical flag to control whether the coast-line is plotted.
add
logical flag: if TRUE, the plot is superimposed on the existing plot; otherwise, a new plot is generated.
xlim
limits for the x-axis (longitude).
ylim
limits for the y-axis (latitude).
fifty
logical flag: if TRUE, boxes are drawn in the Pacific Ocean to represent Alaska and Hawaii.

Graphical parameters may also be supplied as arguments to this function (see ).

SIDE EFFECTS:

a plot is produced on the current graphics device. It is added to the current plot if add=TRUE, and creates a new plot otherwise.

DETAILS:

The plot is done in correct physical proportion. The coordinate system set up for the plot uses negative longitude, so that x-values increase from left to right on the plot.

The maps library contains a more detailed and accurate map of the United States down to the county level and is recommended over the usa function.

SEE ALSO:

, , . The and datasets.

EXAMPLES:

usa(states=F) # the U.S. without state lines
usa(xlim=c(65, 85), ylim=c(35, 50)) # plot the north-east
usa()
text(state.center, state.abb, cex=.5)
# Plot and label a handful of zip codes
# on a usa() map using latitude and longitude values
dxdy <- data.frame( P.O. = c("Oostburg", "Santa Paula", "Ukiah", "Edmonds"),
      State = c("WI","CA","CA","WA"),
      ZipCode = c(53070, 93060, 95482, 98020),
      Latitude = c(43.6252, 34.3776, 39.1539, 47.8000),
      Longitude = c(-87.7984, -119.1058, -123.2580, -122.3719), stringsAsFactors = F)
usa()
points(x = dxdy$Longitude, y = dxdy$Latitude, pch = 16, cex = 0.4, col = 8)
text(x = dxdy$Longitude, y = dxdy$Latitude, labels = dxdy$P.O., cex = 0.4, col = 8, adj = 1)