--- title: "Polygons with holes for ggplot2" author: "Michael D. Sumner" date: "`r Sys.Date()`" output: rmarkdown::html_vignette: fig_width: 5 fig_height: 3 vignette: > %\VignetteIndexEntry{ggpolypath} %\VignetteEncoding{UTF-8} %\VignetteEngine{knitr::rmarkdown} editor_options: chunk_output_type: console --- ```{r, include = FALSE} options(rmarkdown.html_vignette.check_title = FALSE) ``` ```{r} library(ggpolypath) ggplot(maphome) + aes(x = x_, y = y_, group = branch_, fill = object_) + geom_polypath() ``` The same example, but using the linked per-object metadata. ```{r,eval=TRUE} ggplot(merge(maphome, dathome[, c("object_", "name")])) + aes(x = x_, y = y_, group = branch_, fill = name) + geom_polypath() ``` Something more map. ```{r, fig.height = 6, fig.width = 6} gs <- ggplot(gardenstate) gs <- gs + aes(x = x, y = y, group = group, fill = id) gs + geom_polypath() + geom_path() + coord_equal() ```