Description Usage Arguments Details Value Note See Also Examples
Query or (to a limited extent) change the dimtypes of an object.
1 2 3 4 5 6 7 8 9 |
object |
Object of class |
use.names |
Logical. Whether to include the names of the dimensions in the return value. |
value |
Character vector of valid dimtypes. See table below for a list of valid dimtypes. |
Each dimension of a DemographicArray
object has a
'dimtype' describing the type of information held by that dimension.
Examples include "age"
, "time"
, and "state"
. See below
for details.
Every dimension of a DemographicArray
object has a
dimtype. A dimtype identifies the type of variable encoded by the
dimension.
The table below lists valid dimtypes. The dimtypes from "age"
to
"destination"
are the most commonly-encountered, with the remaining
dimtypes being more specialized. Different dimtypes require different
dimscales
.
dimtype | Description | Permitted dimscales |
"state" | Any qualitative attribute | "Categories" |
"age" | Age | "Intervals" , "Points" |
"sex" | Sex | "Sexes" |
"time" | Periods or exact times | "Intervals" ,
"Points" |
"origin" , "destination" | Starting and finishing states | "Categories" |
"parent" , "child" | Parent's state versus child's state | "Categories" |
"cohort" | Cohort | "Intervals" |
"iteration" | Simulation number | "Iterations" |
"quantile" | Quantile (between 0 and 1) | "Quantiles"
|
"triangle"
| Lexis triangle | "Triangle" |
"state"
. The default dimtype, used for any attribute
that is not dealt with by the more specialized dimtypes.
"age"
. Age, measured on a numerical scale Can be 'exact' ages, or
age-groups. If age is measured qualitatively (eg "children"
and
"adults"
), then dimtype "state"
should be used instead. An
object can have at most one dimension with dimtype "age"
.
"sex"
. Biological sex.
"time"
. Time, measured on a numerical scale. Can be points in time,
or intervals between points in time. If time is measured qualitatively (eg
"before"
and "after"
), then dimtype "state"
should be
used instead.
"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.
dimtypes
returns a character vector with the dimtypes of each
dimension.
The replacement method changes the dimtypes of object
.
Changing the dimtype of a dimension in an existing object can be
tricky, since the dimension may have dimscales
that are not
permitted for the new dimtype. If major changes to the dimtypes and
dimscales of an object are required, it may be easiest to create the object
again from scratch, perhaps using as.array
on the object
first.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.