[R] add city and point in the map
Alan Schussman
schussma at u.arizona.edu
Thu Apr 27 18:39:22 CEST 2006
YIHSU CHEN <yschen <at> jhu.edu> writes:
>
> Dear Helpers:
>
> I'm trying to use packages "maps" and "mapdata" (see blow) to display the
research resutls on map
> (Mid-Atlantic region). In particular, I need to mark a number of points in
the map by giving their latitude
> and longitude information. For instance, I would like to mark a point on
(long, lat) =(75.56027,
You can use library(mapproj) and the function mapproject() to do this.
mapproject converts longitude and latitude to x and y projections on a plot, as
in the following:
map('usa')
locations <- mapproject(longitude, latitude)
points(locations)
-Alan
--
-Alan Schussman / Graduate Associate
University of Arizona Department of Sociology
More information about the R-help
mailing list