spline.interpolation: Detection and spline interpolation of missing values in...

View source: R/spline.interpolation.R

spline.interpolationR Documentation

Detection and spline interpolation of missing values in dendrometer data.

Description

This function detects gap(s) in time series, inserts the missing rows based on the provided temporal resolution and assings NA values to the corresponding value. If required the NA values can be replaced by spline interpolation using na.spline of the package zoo.

Usage

spline.interpolation(df, resolution, fill = FALSE)

Arguments

df

dataframe with first column containing date and time in the format yyyy-mm-dd HH:MM:SS and following columns with dendrometer data for the same temporal resolution and time period.

resolution

integer, indicating the resolution of dendrometer data in minutes.

fill

logical, if TRUE it fills the NA values using spline interpolation. Default is FALSE.

Value

A dataframe containing the dendrometer data including gaps filled with either NA or interpolated values.

Examples

library(dendRoAnalyst)
data(nepa17)
gf_nepa17<-spline.interpolation(df=nepa17, resolution=60)
head(gf_nepa17,10)


dendRoAnalyst documentation built on Nov. 16, 2022, 9:07 a.m.