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 \code{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)

}
michaeldorman/starsExtra documentation built on Jan. 19, 2024, 8:54 a.m.