na_rate: na_rate

View source: R/na_rate.R

na_rateR Documentation

na_rate

Description

Extend a timeseries dataset and apply an annual growth rate to it

Usage

na_rate(x, rate = 1.1)

Arguments

x

Vector with NAs in future time to fill

Value

Numeric values with a constant rate applied to lagged values.

Examples

## Not run: 
tibble::tibble(START_YEAR = c(2018:2020),
                     VALUE = c(1,2,3)) %>%
 dplyr::bind_rows(tibble::tibble(START_YEAR = c(2021:2024))) %>%
 dplyr::mutate(VALUE = na_rate(VALUE, rate = 0.98))


## End(Not run)


toddellis/miao documentation built on June 1, 2025, 10:11 p.m.