R/polygon2.R

Defines functions polygon2

Documented in polygon2

#' @title polygon2
#' @description wrapper for polygon which makes it behave like other types of base R plotting
#' @param x x axis coordinate
#' @param y y axis coordinate
#' @examples
#' @author Will Gittens
#' @export
polygon2 <- function(x,y, ...){
xx <- c(x, rev(x))
yy <- c(rep(0, length(x)), rev(y))
polygon(xx, yy, ...)
}
WHG1990/CCTools documentation built on June 16, 2024, 1:36 a.m.