View source: R/time_interpolate.R
time_interpolate | R Documentation |
Function to extrapolate missing years in MAgPIE objects.
time_interpolate(
dataset,
interpolated_year,
integrate_interpolated_years = FALSE,
extrapolation_type = "linear"
)
dataset |
An MAgPIE object |
interpolated_year |
Vector of years, of which values are required. Can be in the formats 1999 or y1999. |
integrate_interpolated_years |
FALSE returns only the dataset of the interpolated year, TRUE returns the whole dataset, including all years of data and the itnerpolated year |
extrapolation_type |
Determines what happens if extrapolation is
required, i.e. if a requested year lies outside the range of years in
|
Uses linear extrapolation to estimate the values of the interpolated year, using the values of the two surrounding years. If the value is before or after the years in data, the two closest neighbours are used for extrapolation.
Benjamin Bodirsky, Jan Philipp Dietrich
convergence
p <- maxample("pop")
time_interpolate(p, "y2000", integrate = TRUE)
time_interpolate(p, c("y1980", "y2000"), integrate = TRUE, extrapolation_type = "constant")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.