findDupes: Finds duplicated datetimes in obs dataframe

View source: R/findDupes.R

findDupesR Documentation

Finds duplicated datetimes in obs dataframe

Description

Finds duplicate datetime values. All of the duplicate values are written to a .csv file. Many time series, especially from Environment Canada, may contain duplicate datetimes.

Usage

findDupes(obs, dupefile = "", quiet = TRUE, logfile = "")

Arguments

obs

Required. A CRHMr data frame containing obs values.

dupefile

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

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 there are duplicate datetimes, returns TRUE. If there are no duplicates, returns FALSE.

Note

If quiet=FALSE, the function gives a list of the duplicate datetimes. Use this function before removing duplicates and/or interpolation and imputation. Most importantly, use this function before writing values to an obs file. Duplicate datetime values in an obs file will prevent CRHM from executing.

Author(s)

Kevin Shook

See Also

findGaps interpolate impute writeObsFile

Examples

findDupes(BadLake7376, quiet=FALSE)

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