| pairToState {dembase} | R Documentation |
dimtypes "origin" and "destination",
and dimtypes "parent" and "child",
always come in pairs. If one of these dimensions is collapsed,
the remaining dimension is converted to dimtype "state",
and the "_orig", "_dest", "_parent"
or "_child" suffix in its name disappears.
Normally this behaviour is useful, but sometimes it is not.
pairToState converts all dimensions
in object with dimtype "origin",
"destination", "parent", or "child"
to dimtype "state". To conform to the rule
that paired dimensions, and only paired dimensions, have
suffixes code"_orig", "_dest", "_parent"
or "_child", the names of transformed dimensions
are changed, with the "_" characters in the
suffixes being changed to ".".
pairToState(object) ## S4 method for signature 'DemographicArray' pairToState(object)
object |
An object of class |
An object with the same class as object,
but with altered dimtypes and names, if any paired dimtypes were
present in object.
For descriptions of dimtypes and the rules that govern
them, see dimtypes. Dimensions are collapsed
using function collapseDimension.
x <- Counts(array(1:9,
dim = c(3, 3),
dimnames = list(region_orig = c("A", "B", "C"),
region_dest = c("A", "B", "C"))))
x
pairToState(x)