R/hasCoords.R

Defines functions hasCoords

Documented in hasCoords

#' Has Coordinates
#'
#' Checks, whether object contains coordinates.
#'
#'
#' @param x MAgPIE object
#' @param xlab label of x-dimension
#' @param ylab label of y-dimension
#' @return Boolean indicating whether coordinates were found or not
#' @author Jan Philipp Dietrich
#' @seealso \code{\link{getCoords}}
#' @examples
#'
#' hasCoords(maxample("pop"))
#' hasCoords(maxample("animal"))
#'
#' @family ObjectInfo
#' @export
hasCoords <- function(x, xlab = "x", ylab = "y") {
  return(all(dimExists(c(xlab, ylab), x)))
}

Try the magclass package in your browser

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

magclass documentation built on June 29, 2026, 5:06 p.m.