File: fortify.map.Rd

package info (click to toggle)
r-cran-ggplot2 3.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 9,944 kB
  • sloc: sh: 15; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 900 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
31
32
33
34
35
36
37
38
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fortify-map.R
\name{fortify.map}
\alias{fortify.map}
\title{Fortify method for map objects}
\usage{
\method{fortify}{map}(model, data, ...)
}
\arguments{
\item{model}{map object}

\item{data}{not used by this method}

\item{...}{not used by this method}
}
\description{
This function turns a map into a data frame that can more easily be
plotted with ggplot2.
}
\examples{
if (require("maps")) {
ca <- map("county", "ca", plot = FALSE, fill = TRUE)
head(fortify(ca))
ggplot(ca, aes(long, lat)) +
  geom_polygon(aes(group = group))
}

if (require("maps")) {
tx <- map("county", "texas", plot = FALSE, fill = TRUE)
head(fortify(tx))
ggplot(tx, aes(long, lat)) +
  geom_polygon(aes(group = group), colour = "white")
}
}
\seealso{
\code{\link[=map_data]{map_data()}} and \code{\link[=borders]{borders()}}
}
\keyword{internal}