R/clhs-raster.R

Defines functions clhs.Raster

Documented in clhs.Raster

#' @include clhs-data.frame.R
#' @rdname clhs
#' @importFrom raster rasterToPoints
#' @method clhs Raster
#' @export
#' @noRd
clhs.Raster <- function(
  x, # data
  ...
  ){
  spdf <- rasterToPoints(x, spatial = TRUE)
  spl <- clhs(x = spdf, ...)
  
  dots <- list(...)
  simple <- dots$simple
  
  if (length(simple) == 0) simple <- TRUE
  
  if (!simple) {
    spl$initial_object <- x
  }
  
  spl
}

Try the clhs package in your browser

Any scripts or data that you put into this service are public.

clhs documentation built on Oct. 14, 2021, 9:06 a.m.