| HouseholdMember | R Documentation |
The HouseholdMember class aggregates information about
a single member of a household.
An object of class HouseholdMember.
max_ageThe maximum age of the household member
modeThe Gompertz mode parameter
dispersionThe Gompertz dispersion parameter
new()Creating a new object of class HouseholdMember
HouseholdMember$new(name, birth_date, mode = NULL, dispersion = NULL)
nameThe name of the member.
birth_dateThe birth date of the household member
in the format YYYY-MM-DD.
modeThe Gompertz mode parameter.
dispersionThe Gompertz dispersion parameter.
print()Printing the household member object
HouseholdMember$print(current_date = get_current_date())
current_dateA date in the format "YYYY-MM-DD".
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_dateA 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_dateA 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_dateA 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_ageTarget age (numeric, in years).
current_dateA 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)
eventThe name of the event.
start_ageThe age of the household member when the event starts.
end_ageThe age of the household member when the event ends.
yearsThe number of years the event lasts.
clone()The objects of this class are cloneable with this method.
HouseholdMember$clone(deep = FALSE)
deepWhether 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.