This function approximate NA (missing) values. It was designed to fill only small gaps in microclimatic time-series therefore, the default maximum length of the gap is 5 missing records and longer gaps are not filled Only linear method is implemented from zoo::na.approx function.

mc_prep_fillNA(
  data,
  localities = NULL,
  sensors = NULL,
  maxgap = 5,
  method = "linear"
)

Arguments

data

cleaned myClim object see myClim-package

localities

names of localities; if NULL then all (default NULL)

sensors

names of sensors; if NULL then all (default NULL) see names(mc_data_sensors)

maxgap

maximum number of consecutively NA values to fill (default 5)

method

used for approximation. It is implemented now only "linear". (default "linear")

Value

myClim object with filled NA values