View source: R/network_utils.R
get_rate | R Documentation |
Get rate based on linear interpolation
get_rate(init_date, times, rates, at)
init_date |
Object of class Date. Initial date for the start of simulations in the form of "YEAR-MONTH-DAY". |
times |
Vector of times for interpolation |
rates |
Vector os respective rates (related to times) |
at |
time step in days |
rate based on linear interpolation. See approx
.
# times <- c(2000:2019)
# rates <- c(1.445432e-06, 1.455312e-06, 1.414593e-06, 1.346566e-06,
# 1.329516e-06, 1.281034e-06, 1.445432e-06, 1.455312e-06,
# 1.414593e-06, 1.346566e-06, 1.329516e-06, 1.281034e-06,
# 1.288603e-06, 1.250734e-06, 1.265186e-06, 1.234629e-06,
# 1.193328e-06, 1.133912e-06, 1.099263e-06, 1.052727e-06)
# init_date <- as.Date("1980-01-01")
# new_rate <- get_rate(init_date, times, rates, at = 10000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.