| thinIterations {dembase} | R Documentation |
Given an object of class DemographicArray that has a
dimension with dimtype "iteration", return a new
object containing a subset of the original iterations.
thinIterations(object, n) ## S4 method for signature 'DemographicArray' thinIterations(object, n)
object |
Object of class |
n |
The number of iterations to retain. |
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.
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.
x <- Counts(array(1:6,
dim = c(2, 3),
dimnames = list(sex = c("Female", "Male"), iteration = 1:3)))
thinIterations(x, n = 2)