R/geom_hurricane.R

Defines functions geom_hurricane

GeomHurricane <- ggplot2::ggproto(
  "GeomHurricane",
  ggplot2::GeomPolygon,
  required_aes = c("x", "y"),
  draw_key = ggplot2::draw_key_polygon,
  default_aes = ggplot2::aes(alpha = 0.5, fill = "red", color = "red", linetype = 1, size = 0.5)
)

geom_hurricane <-
  function(mapping = NULL,
           data = NULL,
           stat = "hurricane",
           position = "identity",
           show.legend = NA,
           na.rm = FALSE,
           inherit.aes = TRUE,
           scale_radii = 1,
           ...) {
    ggplot2::layer(
      data = data,
      mapping = mapping,
      stat = stat,
      geom = GeomHurricane,
      position = position,
      show.legend = show.legend,
      inherit.aes = inherit.aes,
      params = list(na.rm = na.rm, scale_radii = scale_radii, ...)
    )
  }
mykoCheng/ANewGeom documentation built on May 5, 2019, 12:31 p.m.