showTotal: Whether a LifeTable objects shows a "total" category for sex

Description Usage Arguments Details Value See Also Examples

Description

Extract or change the showTotal slot of an object of class LifeTable. The showTotal slot controls whether a "total" category is shown, in addition to "female" and "male" categories. It only has an effect if the life table has a dimension with dimtype "sex".

Usage

1
2
3
4
5
6
7
8
9
showTotal(object)

showTotal(object) <- value

## S4 method for signature 'LifeTable'
showTotal(object)

## S4 replacement method for signature 'LifeTable'
showTotal(object) <- value

Arguments

object

An object of class LifeTable.

value

Logical.

Details

showTotal does not affect the underlying data. A LifeTable only stores "female" and "male" categories; totals are generated as needed.

Value

The extraction function returns TRUE or FALSE, and the replacement function returns a LifeTable object with a new value for the showTotal slot.

See Also

Life tables are created using function LifeTable.

Examples

1
2
3
4
5
6
7
8
9
al <- demdata::afghan.life
al <- dembase::Values(al)
mx <- dembase::subarray(al,
               subarray = (fun == "mx") & (time == "2001-2005"))
lt <- LifeTable(mx)
lt
showTotal(lt)
showTotal(lt) <- FALSE
lt

StatisticsNZ/demlife documentation built on April 27, 2021, 10:02 p.m.