| showTotal {demlife} | R Documentation |
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".
showTotal(object) showTotal(object) <- value ## S4 method for signature 'LifeTable' showTotal(object) ## S4 replacement method for signature 'LifeTable' showTotal(object) <- value
object |
An object of class |
value |
Logical. |
showTotal does not affect the underlying data. A
LifeTable only stores "female" and "male"
categories; totals are generated as needed.
The extraction function returns TRUE or FALSE,
and the replacement function returns a LifeTable object
with a new value for the showTotal slot.
Life tables are created using function LifeTable.
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