diff --git a/00_COMMON/COMMON_00_R_functions.R b/00_COMMON/COMMON_00_R_functions.R index b44475ba610f148f1101c3f7ddaa40028c15ca63..e61834c6a49400c0ed92111992938ec052a58e99 100644 --- a/00_COMMON/COMMON_00_R_functions.R +++ b/00_COMMON/COMMON_00_R_functions.R @@ -23,7 +23,7 @@ ###################################################################### #' Subset a total population to a target sample size stratified by age and sex. #' -#' @param x A data.frame containing the population inventory in a wide format. It should be the output of \code{INVENTORY_02_list_all_inventory_participants.R}. +#' @param x A data.frame containing the population inventory in a long format. It should be the output of \code{INVENTORY_02_list_all_inventory_participants.R}. #' @param n_target A (named) vector containing the target sample size in a cluster. If named, the names are expected to exactly match the country codes in the data.frame \code{x}. In case \code{n_target} is unnamed and/or has length 1, its value is recycled for all countries in \code{x}. #' @param n_backup A (named) vector containing the number of individuals to include in a backup list that will come in addition to the primary list. If named, the names are expected to exactly match the country codes in the data.frame \code{x}. In case \code{n_backup} is unnamed and/or has length 1, its value is recycled for all countries in \code{x}. #' @return A random sample subset from \code{x} where individuals are representative of those from the whole population in terms of age-(categorical)-and-sex-structure, within each country and cluster.