R/whipala_map.R

Defines functions whipala_map

#' Plots a raster to a whipala
#'
#' @param raster a raster pbject
#'
#' @export
#' @examples
#' br <- raster::getData("alt", country = "BRA")
#' br <- aggregate(br, 150)
#' whipala_map(br)
whipala_map <- function(raster) {
  #cria um raster de mesmas dimensões e valores whip
  whipr <- whipala(ncol = ncol(raster), nrow = nrow(raster), plot = FALSE)
  raster::extent(whipr) <- raster::extent(raster)
  whipmap <- raster::mask(whipr, raster)
  raster::plot(whipmap, col = whipalette, legend = F)
}
liibre/whipala documentation built on Feb. 4, 2021, 12:05 a.m.