R/ncells.R

Defines functions ncells

Documented in ncells

#' Count elements
#'
#' Functions to count the number of cells/years/datasets/regions of an
#' MAgPIE-object
#'
#' @aliases ncells nyears ndata nregions
#' @param x A MAgPIE-object
#' @return \item{value}{The number of cells/years/datasets/regions of \code{x}}
#' @author Jan Philipp Dietrich
#' @examples
#'
#' a <- is.magpie(NULL)
#' ncells(a)
#' nyears(a)
#' ndata(a)
#' nregions(a)
#' @export
ncells <- function(x) {
  return(dim(x)[1])
}

Try the magclass package in your browser

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

magclass documentation built on July 9, 2023, 7:03 p.m.