View source: R/approx_demographics.R
| approx_demographics | R Documentation | 
Interpolate yearly population estimates so that a population estimate is provided for each day of the year. The function 'approx' is used with 'rule = 2' for extrapolation.
approx_demographics(
  demo,
  first_day,
  last_day,
  by,
  extrapolation.type = c("linear", "constant", "none"),
  ...
)
demo | 
 A data frame with the yearly population estimates. Must have a numeric column named year and a numeric column named population.  | 
first_day | 
 First day to interpolate. If missing the first day of the first year in demo is used.  | 
last_day | 
 Last day to interpolate. If missing the last day of the last year in demo is used.  | 
by | 
 Vector of column names to group by, for example different demographic strata. If missing it will extrapolate within each strata. To collapse all strata, define as by = NULL.  | 
extrapolation.type | 
 Type of extrapolation. Either linear, constant, or none. If none is selected the NAs are returned.  | 
... | 
 additional parameters sent to the function 'approx'.  | 
A data frame with dates and population estimates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.