| drop {dembase} | R Documentation |
Like the drop function for ordinary arrays, the method for
DemographicArray objects removes dimensions with length 1.
x |
Object of class |
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.
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)