Skip to contents

create_mortality_long_df

Usage

create_mortality_long_df(
  df_main,
  date_dc = "today",
  date_recall_event = "recall_date",
  enumerator = NULL,
  cluster = NULL,
  admin1 = NULL,
  admin2 = NULL,
  uuid_main = NULL,
  df_roster,
  sex_roster = "sex_roster",
  age_roster = "calc_final_age_years",
  joined_roster = "joined",
  birth_roster = "ind_born",
  birthdate_roster = "final_ind_dob",
  joined_date_roster = "final_date_join",
  uuid_roster = NULL,
  collected_df_left = TRUE,
  df_left = NULL,
  sex_left = "sex_left",
  age_left = "calc_final_age_years_left",
  birth_left = "ind_born_left",
  joined_left = "left_present",
  joined_date_left = "final_date_join_left",
  left_date_left = "final_date_left",
  birthdate_left = "final_ind_dob_left",
  uuid_left = NULL,
  df_died,
  sex_died = "sex_died",
  age_died = "calc_final_age_years_died",
  birth_died = "ind_born_died",
  joined_died = "died_present",
  death_cause = "cause_death",
  death_location = "location_death",
  date_death = "final_date_death",
  joined_date_died = "date_join_final_death",
  birthdate_died = "dob_died",
  uuid_died = NULL
)

Arguments

df_main

Main Dataset

date_dc

the name of the variable that indicates the date of data collection By default: "today"

date_recall_event

the name of the variable that indicates the recall date By default: "recall_date"

enumerator

the name of the variable that indicates the enumerator By default: NULL

cluster

the name of the variable that indicates the cluster By default: NULL

admin1

the name of the variable that indicates the admin 1 By default: NULL

admin2

the name of the variable that indicates the admin 2 By default: NULL

uuid_main

the name of the variable that indicates the unique uuid By default: NULL

df_roster

Roster Dataset

sex_roster

the name of the variable that indicates the sex of the individuals By default: "sex_roster"

age_roster

the name of the variable that indicates the age by year of the individuals By default: "calc_final_age_years"

joined_roster

the name of the variable that indicates if the individuals joined the HH By default: "joined"

birth_roster

the name of the variable that indicates if the individuals joined the HH By default: "joined"

birthdate_roster

the name of the variable that indicates if the date of birth of child under 6. By default: "final_ind_dob"

joined_date_roster

the name of the variable that indicates if the date individuals joined the HH. By default: "final_date_join"

uuid_roster

the name of the variable that indicates the unique uuid of HH By default: NULL

collected_df_left

Boolean value to check if df_left is collected. By default: T

df_left

Left Dataset

sex_left

the name of the variable that indicates the sex of the individuals By default: "sex_left"

age_left

the name of the variable that indicates the age by year of the individuals By default: "calc_final_age_years_left"

birth_left

the name of the variable that indicates if any of the leavers were born. By default: "ind_born_left"

joined_left

the name of the variable that indicates if any of the leavers joined the HH. By default: "left_present"

joined_date_left

the name of the variable that indicates the date the leavers joined the HH. By default: "final_date_join_left"

left_date_left

the name of the variable that indicates the date the leavers left the HH. By default: "final_date_left"

birthdate_left

the name of the variable that indicates the date the leavers were born. By default: "final_ind_dob_left"

uuid_left

the name of the variable that indicates the unique uuid of HH By default: NULL

df_died

Death Dataset

sex_died

the name of the variable that indicates the sex of the individuals By default: "sex_died"

age_died

the name of the variable that indicates the age by year of the individuals By default: "calc_final_age_years_died"

birth_died

the name of the variable that indicates if any of the death were born. By default: "ind_born_died"

joined_died

the name of the variable that indicates if any of the death joined the HH. By default: "died_present"

death_cause

the name of the variable that indicates the cause of death By default: "cause_death"

death_location

the name of the variable that indicates the location of death By default: "location_death"

date_death

the name of the variable that indicates the date of death By default: "final_date_death"

joined_date_died

the name of the variable that indicates the date death joiners joined the HH, By default: "date_join_final_death"

birthdate_died

the name of the variable that indicates the date of birth of the death individuals. By default: "dob_died"

uuid_died

the name of the variable that indicates the unique uuid of HH By default: NULL

Value

return a long reformated dataframe including all roster/left/death individuals

Examples

if (FALSE) { # \dontrun{
  create_mortality_long_df(df_main,date_dc = "today",
  date_recall_event = "recall_date",
  enumerator = "enumerator",cluster = "cluster",
  admin1 = "admin1",admin2 = "admin2",
  uuid_main = "uuid", df_roster,sex_roster = "sex_roster",
  age_roster = "calc_final_age_years",
  joined_roster = "joined",birth_roster = "ind_born",
  birthdate_roster = "final_ind_dob",
  joined_date_roster = "final_date_join",
  uuid_roster = "_submission__uuid", df_left,sex_left = "sex_left",
  age_left = "calc_final_age_years_left",birth_left = "ind_born_left",
  joined_left = "left_present",joined_date_left = "final_date_join_left",
  left_date_left = "final_date_left",birthdate_left = "final_ind_dob_left",
  uuid_left = "_submission__uuid", df_died,sex_died = "sex_died",
  age_died = "calc_final_age_years_died",
  birth_died = "ind_born_died",joined_died = "died_present",
  death_cause = "cause_death", death_location = "location_death",
  date_death = "final_date_death", joined_date_died = "date_join_final_death",
  birthdate_died = "dob_died",uuid_died = "_submission__uuid")
} # }