usa(states=T, coast=T, add=F, xlim=c(-130,-65), ylim=c(24,50), fifty=F)
TRUE, the plot is superimposed on the existing
plot; otherwise, a new plot is generated.
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 ).
add=TRUE,
and creates a new plot otherwise.
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.
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)