R/docs-args.R

## 'data' argument ------------------------------------------------------------

#' Data argument for data models
#'
#' \code{data} is a data frame containing observations
#' for a single dataset.
#'
#' \describe{
#'   \item{columns}{
#'     \code{data} must always have the following variables (in any order):
#'     \code{age}, \code{cohort}, \code{time}, \code{count}. It must also
#'     have a \code{sex} column or a \code{gender} variable, but not both.
#'     It can optionally have a \code{region} variable.
#'   }
#'   \item{classification variables}{
#'     \code{age}, \code{cohort}, \code{time}, \code{sex}, \code{gender},
#'     and \code{region} are all classification variables. These variables
#'     cannot contain \code{NA}s. \code{age}, \code{cohort}, and \code{time}
#'     must consist of non-negative whole numbers. The classification
#'     variables cannot contain any duplicate rows - for instance, in a
#'     data frame with \code{age}, \code{cohort}, \code{time}, and
#'     \code{gender}, variables, there must not be two rows with the
#'     same combination of values for age, cohort, time, and gender.
#'   }
#'   \item{count variable}{
#'     \code{count} must consist of non-negative whole numbers. It can
#'     contain \code{NA}s.
#'   }
#' }
#'
#' @section Warning:
#'
#' With the partial exception of births (described below),
#' combinations of classification variables not included
#' in \code{data} are treated as missing rather than zero.
#' by functions in package \code{account}.
#' For instance, if \code{data} does
#' not contain a row for cohort \code{2005}, age \code{10},
#' gender \code{"Female"}, and time \code{2020}, then,
#' internally, the count variable for this combination of
#' characteristics is set to \code{NA} rather than \code{0}.
#' If the observed count for a combination of variables
#' is zero, then this zero should be included in \code{data}.
#'
#' Datasets describing births are treated slightly different.
#' Births outside the reported age range (eg 15-49) and births
#' to the sex/gender not coded as "dominant" (GIVE LINK) are assumed
#' to be zero.
#' 
#' @name data-arg
NULL




## 'rates' argument -----------------------------------------------------------

#' rates argument
#'
#' Births do not have a sex dimension
#' 
#' NEED TO WRITE THIS
#' 
#' @name rates-arg
NULL
ONSdigital/Bayesian-demographic-accounts documentation built on Jan. 10, 2022, 12:34 a.m.