nIteration: Get the number of iterations in a demographic array.

Description Usage Arguments Value Author(s) See Also Examples

Description

If an object of class DemographicArray has a dimension with dimtype "iteration", return the lenth of that dimension; if not, raise an error.

Usage

1
2
3
4
nIteration(object)

## S4 method for signature 'DemographicArray'
nIteration(object)

Arguments

object

Object of class DemographicArray.

Value

An integer.

Author(s)

John Bryant demographic.packages@gmail.com

See Also

dimtypes, collapseIterations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(demdata)
x <- Counts(array(replicate(n = 5, rnorm(2)),
                  dim = c(2, 5),
                  dimnames = list(sex = c("Female", "Male"),
                      iteration = 1:5)))
nIteration(x)

x <- Counts(VAPopn)
## no dimension with dimtype "iteration"
## Not run: nIteration(x)

StatisticsNZ/dembase documentation built on Dec. 25, 2021, 4:49 p.m.