Description Usage Arguments Details Value See Also Examples
Given an object of class DemographicArray
, make dimensions with
dimtype
"origin"
and "destination"
or "parent"
and "child"
consistent. This is done by permuting and inserting rows.
1 2 3 4 5 6 7 8 9 10 11 12 |
object |
Object of class |
base |
Character vector giving the "base names" for the dimension pairs.
If |
omitted |
Value to be used for omitted origin-destination or parent-child
combinations. Defaults to |
The "base name" of a dimension with dimtype
"origin"
,
"destination"
, "parent"
, or "child"
is the name minus
the "_orig"
, "_dest"
, "_parent"
, or "_child"
suffix. For instance, the base name of "region_orig"
and
"region_dest"
is "region"
.
An object with the same class as object
.
Function pairAligned
tests whether a pair of dimensions
use the same categories in the same order.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | x <- Counts(array(1:4,
dim = c(2, 2),
dimnames = list(region_orig = c("a", "b"),
region_dest = c("c", "b"))))
x
alignPair(x, base = "region")
alignPair(x)
alignPair(x, omitted = NA)
y <- Values(array(1:8,
dim = c(2, 2, 1, 2),
dimnames = list(region_orig = c("a", "b"),
region_dest = c("b", "a"),
ethnicity_parent = "q",
ethnicity_child = c("q", "r"))))
y
alignPair(y, base = "region")
alignPair(y, base = "ethnicity")
alignPair(y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.