fill_serie {hydroToolkit}R Documentation

Find non-reported dates and fill them with NA_real_

Description

This function complete non-reported dates and assign NA_real_ as their value.

Usage

fill_serie(df, colName, timeStep)

Arguments

df

data frame with date and numeric vector as first and second column respectively.

colName

output colname of the numeric variable, e.g.: 'Qmd(m3/s)'.

timeStep

character with a valid time step: 'day', 'month', '4h', 'day/3', 'hour'.

Value

A data frame with missing time steps filled with NA's.

Examples

# Create a data frame
dates   <- seq.Date(from = as.Date('1990-01-01'), to = as.Date('1990-12-01'), by = 'm')
met_var <- runif(n = 12, 0, 10)

met_serie <- data.frame(dates, met_var)

# Fill serie
met_fill  <- fill_serie(df = met_serie, colName = 'Temp', timeStep = 'day')


[Package hydroToolkit version 0.1.0 Index]