#' Calculate the expected sample size for a given group
#'
#' @param n_obs The number of observations in a group nested within a cluster.
#' @param n_tot The total number of inhabitants in the corresponding cluster.
#' @param n_target The total target sample size in the cluster.
#' @return The number of participants to sample among the group of interest in the cluster population or, if there's too few, the total number of observations in that group.
#' @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 wide format. It should be the output of \code{INVENTORY_02_list_all_inventory_participants.R}.
#' @param clusterid The cluster ID to restrict the data to.
#' @param n_target The total target sample size in the cluster.
#' @return Writes the subset list into a dedicated CSV file.