is_quant_scale: See whether cross-classifying dimensions of demographic array...

Description Usage Arguments Details Value See Also Examples

Description

See how functions in demarray and associated packages will interpret the labels from each dimension of a demographic array or account.

Usage

1
2
3
4
is_quant_scale(x)

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

Arguments

x

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

Details

Each dimension of a demographic array has a measurement scale. A dimension may, for instance, represent age using years since birth, or represent geographical region using the name of that region. Years since birth is an example of a quantitative measurement scale, and region name is an example of a qualitative measurement scale. Functions in demarray and associated packages infer measurement scales from dimtypes and dimnames.

Function is_quant_scale returns a logical vector stating, for each dimension of a demographic array, whether the that dimension has quantitative measurement scale. When used with a demographic account, is_quant_scale returns the values for the population series.

To change the dimnames, and hence, potentially, to switch between quantitative and qualitative scales, use base function dimnames.

Value

A named logical vector.

See Also

dimtypes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- Counts(array(1:8,
                  dim = c(2, 2, 2),
                  dimnames = list(sex = c("Female", "Male"),
                                  age = c("0-39", "40+"),
                                  month = c("2015 Jan", "2015 Jul"))))
x
is_quant_scale(x)
dimnames(x)$age <- c("Young", "Old")
x
is_quant_scale(x)

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