Learn R Programming

RGENERATE (version 1.3.7)

gapFilling: gapFilling

Description

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

Usage

gapFilling(x = NULL, ...)

# S3 method for default gapFilling(x, objectForGeneration = NULL, ...)

# S3 method for 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

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