File: map-data-ax.rd

package info (click to toggle)
r-cran-ggplot2 0.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,084 kB
  • sloc: makefile: 3
file content (30 lines) | stat: -rw-r--r-- 692 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\name{map_data}
\alias{map_data}
\title{Map data}
\author{Hadley Wickham <h.wickham@gmail.com>}

\description{
Convert map to data frame
}
\usage{map_data(map, region = ".")}
\arguments{
\item{map}{map name}
\item{region}{region name}
}



\examples{if (require(maps)) {
states <- map_data("state")
arrests <- USArrests
names(arrests) <- tolower(names(arrests))
arrests$region <- tolower(rownames(USArrests))

choro <- merge(states, arrests, sort = FALSE, by = "region")
choro <- choro[order(choro$order), ]
qplot(long, lat, data = choro, group = group, fill = assault,
geom="polygon")
qplot(long, lat, data = choro, group = group, fill = assault / murder,
geom="polygon")
}}
\keyword{hplot}