gapFilling: gapFilling

gapFillingR Documentation

gapFilling

Description

It fills in a gab of a data frame by using generate method

Usage

gapFilling(x = NULL, ...)

## Default S3 method:
gapFilling(x, objectForGeneration = NULL, ...)

## S3 method for class 'data.frame'
gapFilling(
  x,
  objectForGeneration = NULL,
  max.filling = 2,
  nofill.code = -9999,
  ...
)

Arguments

x

object with gaps to fill

...

further argument for generate method

objectForGeneration

object used for generate method

max.filling

integer values: gap are filled if the previous max.filling values are not NA or nofill.code

nofill.code

Alternative value to NA which indicates the gaps which are not filled

Examples


set.seed(122)
NSTEP <- 1000
x <- rnorm(NSTEP)
y <- x+rnorm(NSTEP)
z <- c(rnorm(1),y[-1]+rnorm(NSTEP-1))
df <- data.frame(x=x,y=y,z=z)
var <- VAR(df,type="none")

dfobs <- df
dfobs[20:30,2] <- NA
n <- nrow(df)
gp <- gapFilling(x=dfobs,objectForGeneration=var,max.filling=2)






ecor/RGENERATE documentation built on July 29, 2022, 3:11 a.m.