drop {dembase}R Documentation

Drop dimensions of length one.

Description

Like the drop function for ordinary arrays, the method for DemographicArray objects removes dimensions with length 1.

Arguments

x

Object of class DemographicArray.

Details

A complication sometimes arises when dropping dimensions of a demographic array that does not arise when dropping dimensions of an ordinary array. When only one dimension from an origin-destination or parent-child pair is dropped, the dimtype of the remaining dimension changes to "state" and the suffix is dropped from its name.

See Also

drop

Examples

library(demdata)
popn <- Counts(VAPopn)
popn <- subarray(popn, sex == "Female", drop = FALSE)
drop(popn)

mig <- Counts(nz.mig)
mig <- subarray(mig, island_dest == "North Island", drop = FALSE)
## note the effect on dimension "island_orig"
## of dropping dimension "island_dest"
drop(mig)

[Package dembase version 0.0.0.119 Index]