ageMinMax {dembase} | R Documentation

## Get or set minimum and maximum ages.

### 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

    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

    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)

[Package dembase version 0.0.0.119 Index]