data
is a data frame containing observations
for a single dataset.
data
must always have the following variables (in any order):
age
, cohort
, time
, count
. It must also
have a sex
column or a gender
variable, but not both.
It can optionally have a region
variable.
age
, cohort
, time
, sex
, gender
,
and region
are all classification variables. These variables
cannot contain NA
s. age
, cohort
, and time
must consist of non-negative whole numbers. The classification
variables cannot contain any duplicate rows - for instance, in a
data frame with age
, cohort
, time
, and
gender
, variables, there must not be two rows with the
same combination of values for age, cohort, time, and gender.
count
must consist of non-negative whole numbers. It can
contain NA
s.
With the partial exception of births (described below),
combinations of classification variables not included
in data
are treated as missing rather than zero.
by functions in package account
.
For instance, if data
does
not contain a row for cohort 2005
, age 10
,
gender "Female"
, and time 2020
, then,
internally, the count variable for this combination of
characteristics is set to NA
rather than 0
.
If the observed count for a combination of variables
is zero, then this zero should be included in 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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.