R/st_normalize_3d.R

Defines functions normalize_3d

Documented in normalize_3d

#' Normalize a 3D 'stars' object
#'
#' Check, and possibly correct, that the input \code{stars} object:
#' \itemize{
#' \item{Has exactly one attribute.}
#' \item{Has exactly three dimensions.}
#' \item{The first two dimensions are spatial, named \code{x} and {y} (in that order).}
#' }
#'
#' @param x A \code{stars} object
#'
#' @return A new \code{stars} object
#' @export
#'
#' @examples
#' # Small example
#' data(landsat)
#' normalize_3d(landsat)

normalize_3d = function(x) {

  # Check & normalize
  x = check_one_attribute(x)
  x = check_3d(x)

  # Return
  return(x)

}

Try the starsExtra package in your browser

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

starsExtra documentation built on Nov. 18, 2021, 5:08 p.m.