HouseholdMember | R Documentation |
The HouseholdMember
class aggregates information about
a single member of a household.
An object of class HouseholdMember
.
max_age
The maximum age of the household member
mode
The Gompertz mode parameter
dispersion
The Gompertz dispersion parameter
new()
Creating a new object of class HouseholdMember
HouseholdMember$new(name, birth_date, mode = NULL, dispersion = NULL)
name
The name of the member.
birth_date
The birth date of the household member
in the format YYYY-MM-DD
.
mode
The Gompertz mode parameter.
dispersion
The Gompertz dispersion parameter.
get_name()
Getting the name of the household member
HouseholdMember$get_name()
get_birth_date()
Getting the birth date of the household member
HouseholdMember$get_birth_date()
calc_age()
Calculating the age of the household member
HouseholdMember$calc_age(current_date = get_current_date())
current_date
A date in the format "YYYY-MM-DD".
get_lifespan()
Calculating a lifespan of the household member
HouseholdMember$get_lifespan(current_date = get_current_date())
current_date
A date in the format "YYYY-MM-DD".
calc_life_expectancy()
Calculating a life expectancy of the household member
HouseholdMember$calc_life_expectancy(current_date = get_current_date())
current_date
A date in the format "YYYY-MM-DD".
calc_survival_probability()
Calculating a survival probability of the household member
HouseholdMember$calc_survival_probability( target_age, current_date = get_current_date() )
target_age
Target age (numeric, in years).
current_date
A date in the format "YYYY-MM-DD".
get_events()
Getting the events related to the household member
HouseholdMember$get_events()
set_event()
Setting an event related to the household member
HouseholdMember$set_event(event, start_age, end_age = Inf, years = Inf)
event
The name of the event.
start_age
The age of the household member when the event starts.
end_age
The age of the household member when the event ends.
years
The number of years the event lasts.
clone()
The objects of this class are cloneable with this method.
HouseholdMember$clone(deep = FALSE)
deep
Whether to make a deep clone.
member <- HouseholdMember$new(
name = "Isabela",
birth_date = "1980-07-15",
mode = 91,
dispersion = 8.88
)
member$calc_age()
member$calc_life_expectancy()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.