R/prepExData.R

Defines functions prepExData

Documented in prepExData

#' Prepare example data
#'
#' Prepare example data included in the package that contain wrapped terra
#' objects. This applies [terra::unwrap()] recursively to the list provided so
#' that all `PackedSpatRasters` are converted to `SpatRasters`.
#'
#' @param x list. Contains elements some of which are packed `SpatRasters`.
#'
#' @return The same list but with unwrapped `SpatRasters`
#' @export
#'
#' @examples
#' CLUSexample
#' prepExData(CLUSexample)
prepExData <- function(x){
  rapply(x, f = terra::unwrap, classes = "PackedSpatRaster", how = "replace")
}

Try the roads package in your browser

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

roads documentation built on June 27, 2024, 5:07 p.m.