approximate_interpolate: Approximate Indicator

Description Usage Arguments See Also Examples

Description

Interpolate missing values between known observations.

Usage

1
approximate_interpolate(dat, maxgap = 3, approx_method = "linear")

Arguments

dat

Eurostat data frame or a data frame derived from create_indicator or create_tables

maxgap

See codena.locf. Defaults to Inf.

approx_method

Defaults to 'linear'. You can use 'constant'. See approxfun

See Also

approxfun in the stats package.

Other approximate functions: approximate_locf(), approximate_nocb()

Examples

1
2
3
4
5
6
7
8
9
{
example_df <- data.frame (
  geo = c(rep("AT", 4), rep("DE", 4)),
  time = rep(as.Date(c("2008-01-01", "2009-01-01",
  "2010-01-01", "2011-01-01")), 2),
  values = c( 1:4, NA_real_, NA_real_, 5,6)
 )
approximate_interpolate( example_df )
}

antaldaniel/musicobservatory documentation built on Nov. 26, 2020, 6:27 p.m.