thinIterations: Reduce the number of iterations in demographic array.

Description Usage Arguments Details See Also Examples

Description

Given an object of class DemographicArray that has a dimension with dimtype "iteration", return a new object containing a subset of the original iterations.

Usage

1
2
3
4
thinIterations(object, n)

## S4 method for signature 'DemographicArray'
thinIterations(object, n)

Arguments

object

Object of class DemographicArray.

n

The number of iterations to retain.

Details

The n iterations to retain are chosen at random, and are numbered 1, 2, ..., n.

If object does not have a dimension with dimtype "iteration", thinIterations throws an error.

See Also

Other functions that can be used to subset a dimension with dimtype "iteration" are subarray, slab, and [. To remove an "iteration" dimension entirely, use collapseIterations.

Examples

1
2
3
4
x <- Counts(array(1:6,
                  dim = c(2, 3),
                  dimnames = list(sex = c("Female", "Male"), iteration = 1:3)))
thinIterations(x, n = 2)

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