parse_census_years_ranges: Parse vector of years containing ranges

View source: R/extract_DemoData_tier1_post_process.R

parse_census_years_rangesR Documentation

Parse vector of years containing ranges

Description

Parses a character vector of times (usually years). Single times are left as-is and converted to numeric (via as.numeric). Ranges in the form "xxxx-yyyy" (e.g., as returned by link{get_census_years}) are replaced by their midpoints, rounded down to the nearest integer, and then converted. This function is called by DDextract_to_pop_count_age_sex_reference. See that function's help file for additional notes.

Usage

parse_census_years_ranges(times)

Arguments

times

A vector of times (probably years), numeric or character, possibly with ranges in the format "xxxx-yyyy" (see “Description”).

Value

A numeric vector of times.

Author(s)

Mark Wheldon

See Also

Other DDSQL_census_years: get_census_years()


markalava/ccmppWPP documentation built on April 21, 2022, 12:36 a.m.