insertMissing: Inserts missing datetimes

View source: R/insertMissing.R

insertMissingR Documentation

Inserts missing datetimes

Description

Many time series have missing rows. This function finds missing rows, and adds rows with the appropriate datetime values and NA_real_ values for all variables. Once the missing values have been added, you can use interpolate or impute to infill them.

Usage

insertMissing(obs, quiet = TRUE, logfile = "")

Arguments

obs

Required. A CRHMr data frame containing obs values.

quiet

Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not used.

Value

If successful returns a modified version of the obs data frame with missing datetime values inserted. All of the missing variables in the inserted rows are replaced by NA_real_ values. If unsuccessful, returns the value FALSE.

Note

This function should be used before doing interpolation or imputation of variables. Note that this function is also called by the function findGaps.

Author(s)

Kevin Shook

See Also

findGaps interpolate impute

Examples

BadLake.withmissing <- insertMissing(BadLake7376, quiet=FALSE)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.