Description Usage Arguments Details Value See Also Examples
Parse cohort labels and convert them to the format used by the dem packages.
1 2 3 | clean_cohort(x, language = "English")
clean_cohort_df(x, language = "English")
|
x |
A numeric or character vector. |
language |
The language in which text labels are written. Defaults to English. |
Intervals that are open on the left
such as "<2000"
are
allowed. Intervals that are open on the right
such as "2000+"
are not.
By default, clean_cohort
assumes that any
text labels are written in English. However,
other languages can be specified using
the language
argument. Current choices are
ADD OVER TIME.
Function clean_cohort_df
returns a data frame
showing how each unique element in x
is
interpreted by function clean_cohort
and whether
the element can be interpreted as a valid
cohort label.
clean_cohort
returns a character vector with the same
length as x
in which labels that have been
parsed are translated to dem formats.
clean_cohort_df
returns a data frame with columns
"input"
, "output"
, and "is_valid"
.
is_valid_cohort
, clean_age
,
clean_period
1 2 3 4 5 6 7 8 9 10 11 12 | x <- c("before 2000",
"after 2000",
"Millenials",
"2020 Jan",
"Q3 2020",
"January 2020",
"2025 first quarter",
"untranslatable",
"2020-2025")
x
clean_cohort(x)
clean_cohort_df(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.