Learn R Programming

RGENERATE (version 1.3)

gapFilling: gapFilling

Description

gapFilling

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

Usage

gapFilling(x = NULL, ...)
"gapFilling"(x, objectForGeneration = NULL, ...)
"gapFilling"(x, objectForGeneration = NULL, max.filling = 2, nofill.code = -9999, ...)

Arguments

x
object with gaps to fill
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
...
further argument for generate method

Examples

Run this code
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)

Run the code above in your browser using DataLab