findGaps: Finds gaps in obs variables

View source: R/findGaps.R

findGapsR Documentation

Finds gaps in obs variables

Description

Finds successive missing values in an obs data frame. This function is useful to show where data are missing, before you use the interpolate or impute functions. All of the gaps in each variable are written to a .csv file.

Usage

findGaps(obs, gapfile = "", minlength = 1, quiet = TRUE, logfile = "")

Arguments

obs

Required. A CRHMr data frame containing obs values.

gapfile

Optional. The name of the output file. If omitted the output file will be the name of the obs data frame, followed by _gaps.csv.

minlength

The minimum gap length included in the analysis (in time steps). Default is 1 time step.

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, and there are gaps, returns TRUE. If successful, and there are no gaps, returns 'No gaps. If unsuccessful, returns FALSE.

Note

If quiet=FALSE, the functions gives a summary of the gaps (number of gaps, their total length) for each year.

Author(s)

Kevin Shook

See Also

insertMissing interpolate impute

Examples

findGaps(BadLake7376, quiet = FALSE)

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