Learn R Programming

dendRoAnalyst (version 0.1.5)

network.interpolation: Interpolation of NA values using the dendrometer network

Description

A function to interpolate the missing data of a dendrometer with the help of other dendrometers from the same site, provided they have the same measurement period and temporal resolution.

Usage

network.interpolation(df, referenceDF, niMethod)

Value

A dataframe with NA values replaced by interpolated data.

Arguments

df

dataframe with first column containing date and time in the format yyyy-mm-dd HH:MM:SS and dendrometer data in the second column and onward. The data gaps must be filled with NA using the gap.interpolation function.

referenceDF

dataframe with other dendrometers to be used as reference for the interpolation. The more dendrometers are included, the more robust will be the interpolation.

niMethod

string, either 'linear' or 'proportional' for interpolation method.

Examples

Run this code
library(dendRoAnalyst)
data("gf_nepa17")
df1<-gf_nepa17
# Creating an artificial reference dataset.
df2<-cbind(gf_nepa17,gf_nepa17[,2:3],gf_nepa17[,2:3])
colnames(df2) <- c('Time','T1','T2','T3','T4','T5','T6')
# Creating gaps in dataset by replacing some of the reading with NA in dataset.
df1[40:50,3]<-NA
# Using proportional interpolation method.
df1_NI<-network.interpolation(df=df1, referenceDF=df2, niMethod='proportional')
head(df1_NI,10)

Run the code above in your browser using DataLab