Interpolate to dimensions missing in a data.table, between dimensions which exist. Uses linear interpolation.
interpolate(dt, id_cols, interpolate_col, value_col, interpolate_vals, ...)
dt | [ |
---|---|
id_cols | [ |
interpolate_col | [ |
value_col | [ |
interpolate_vals | [ |
... | Other arguments to be passed to |
[data.table()
] dt
with added rows for interpolated values.
This function uses stats::approx
to solve a linear interpolation.
Values outside the bounds of known data will be returned as NA. Use
extrapolate()
to get values outside of the bounds of the data.
Consider log transforming your data prior to interpolation if
appropriate.