fill_serie: Find non-reported dates and fill them with 'NA_real_'

Description Usage Arguments Value Examples

View source: R/fill_serie.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
# 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')

hydroToolkit documentation built on July 2, 2020, 1:04 a.m.