dimtypes: Get or set dimtypes

Description Usage Arguments Details Value Examples

Description

Query or modify the dimtypes of an object.

Usage

1
2
3
4
dimtypes(x)

## S4 method for signature 'DemographicArray'
dimtypes(x)

Arguments

x

An object of class DemographicArray. Add reference to demographic account, once we have implemented them.

Details

Every dimension of a demographic array has a 'dimtype' describing the type of information held by that dimension. Examples include "age", "time", and "state". See below for details.

The range of dimtypes are as follows:

dimtype Description Labels
"age" Age, as points or intervals <any>
"time" Time, as points or intervals
"cohort" Cohort, measured as points or intervals <any>
"attribute" Any qualitative attribute <any>
"origin", "destination" Starting and finishing states <any>
"parent", "child" Parent's state versus child's state <any>
"iteration" Simulation number Positive integers
"quantile" Position in distribution Percentage
"triangle" Lexis triangle "Lower", "Upper"
"pool" Type of migration flow "Ins", "Outs"

"origin", "destination". Starting and finishing values for an attribute that is subject to change, such as country of residence. "origin" and "destination" dimensions must come in pairs with a common base name and suffixes "_orig" and "_dest", each "country_orig" and "country_dest". There is no limit to the number of origin-destination pairs that an object may have.

"parent", "child". Parents' attributes versus those of their children. Used to model transmission of attributes such as ethnicity from parents to children. "parent" and "child" dimensions must come in pairs with a common base name and suffixes "_parent" and "_child", e.g. "ethnicity_parent" and "ethnicity_child". There is no limit to the number of parent-child pairs that an object may have.

"iteration". Iteration number from a simulation. An object can have at most one dimension with dimtype "iteration". If an object has a dimension with dimtype "iteration" it may not have a dimension with dimtype "quantile".

"quantile". Sample quantiles, typically summarizing simulation results. An object can have at most one dimension with dimtype "quantile". If an object has a dimension with dimtype "quantile" it may not have a dimension with dimtype "iteration".

"triangle". Lexis triangle.

"pool". Direction of flow in "pool" model of migration.

Value

A named vector

Examples

1
2
3
4
5
x <- DemographicArray(array(1:6,
                 dim = c(2, 3),
                 dimnames = list(sex = c("Female", "Male"),
                                 time = c(2000, 2010, 2020))))
dimtypes(x)

johnrbryant/demarray documentation built on Dec. 31, 2021, 11:57 a.m.