naSpline: Interpolate NAs

Description Usage Arguments Value Examples

Description

This function interpolates NAs in matrices along columns.

Usage

1
naSpline(mat,maxgap=1)

Arguments

mat

A must be a numeric matrix.

maxgap

positive integer indicating over what gaps values can be interpolated. Longer gaps will be less accurate.

Value

Returns the interpolated matrix.

Examples

1
2
3
4
5
6
7
x<-rnorm(100)
x[20]<-30
naData<-badData(x)
fixed<-naSpline(naData)
par(mfrow=c(2,1))
ts.plot(x)
ts.plot(fixed)

FIACH documentation built on May 1, 2019, 8:02 p.m.

Related to naSpline in FIACH...