ageMinMax: Get or set minimum and maximum ages.

Description Usage Arguments Details Value See Also Examples

View source: R/miscellaneous-functions.R

Description

Extract minimum or maximum ages from the dimscales of an object. If the age dimension uses dimscale "Intervals", then the replacement version of minAge can be used to change the lower limit of the first age group, and the replacement version of maxAge can be used to change upper limit of the last age group.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
ageMax(object)

ageMax(object) <- value

ageMin(object)

ageMin(object) <- value

setAgeMax(object, value)

setAgeMin(object, value)

## S4 method for signature 'DemographicArray'
ageMax(object)

## S4 replacement method for signature 'DemographicArray'
ageMax(object) <- value

## S4 method for signature 'DemographicArray'
ageMin(object)

## S4 replacement method for signature 'DemographicArray'
ageMin(object) <- value

## S4 method for signature 'DemographicArray'
setAgeMax(object, value)

## S4 method for signature 'DemographicArray'
setAgeMin(object, value)

## S4 method for signature 'MetaData'
ageMax(object)

## S4 replacement method for signature 'MetaData'
ageMax(object) <- value

## S4 method for signature 'MetaData'
ageMin(object)

## S4 replacement method for signature 'MetaData'
ageMin(object) <- value

## S4 method for signature 'MetaData'
setAgeMax(object, value)

## S4 method for signature 'MetaData'
setAgeMin(object, value)

Arguments

object

An object of class DemographicArray or DemographicAccount.

value

A number. Can be Inf.

Details

Functions setAgeMin and sexAgeMax do the same thing as the replacement functions, but work with pipes.

Value

The extraction functions return numbers. The replacement functions, setAgeMin, and setAgeMax return a modified version of object.

See Also

ageTimeStep and hasRegularAgeTime also provide information about age groups. Pipes are described in package magrittr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(demdata)
death.rates <- Values(VADeaths2)
death.rates
ageMin(death.rates)
ageMax(death.rates)
ageMin(death.rates) <- 45
death.rates
ageMax(death.rates) <- Inf
death.rates
setAgeMin(death.rates, value = 50)
setAgeMax(death.rates, value = 75)

StatisticsNZ/dembase documentation built on Dec. 25, 2021, 4:49 p.m.