log_linear_interp: Log-linear interpolation of NA values

log_linear_interpR Documentation

Log-linear interpolation of NA values

Description

Log-linear interpolation of NA values

Usage

log_linear_interp(y, x, rule = 2, replace_na = 0)

Arguments

y

vector of output values, possibly with NAs

x

vector of points to interpolate (no NAs)

rule

rule for extrapolating outside range (see approx())

replace_na

value to replace if interpolation evaluates to NA

Examples

log_linear_interp(c(100, 105, NA, 110), 1:4)
log_linear_interp(c(NA, 105, NA, 110), 1:4)
log_linear_interp(c(NA, 105, NA, 110, NA), 1:5, rule = 1)
log_linear_interp(c(NA, 105, NA, 110, NA), 1:5, rule = 2)
log_linear_interp(c(NA, NA, 37), 1:3, rule = 2)


mrc-ide/naomi documentation built on April 10, 2024, 2:13 p.m.