validate_data: validate_data Discharge timeseries screening

View source: R/validate_data.R

validate_dataR Documentation

validate_data Discharge timeseries screening

Description

Function to check dataframe inputs for appropriate data classes and screen for missing values.

Usage

validate_data(x, yearType, wyMonth = 10L)

Arguments

x

A dataframe containing a vector of date values in the first column and vector of numeric flow values in the second column.

yearType

A character of either "water" or "calendar" indicating whether to use water years or calendar years, respectively.

wyMonth

A numeric. The month of the year in which the water year starts (1=January, 12=December). The water year begins on the first day of wyMonth.

Details

Checks performed ensure the data is valid for use with other EflowStats functions. #'

  1. First column must be of class 'Date'.

  2. Second must be of class 'numeric'.

  3. 'yearType' input must be either "water" or "calendar".

  4. Every year as defined by the 'yearType' input must be complete.

Value

data.frame with rows sorted by date. Boolean FALSE if data is not found to be valid. (See details)

Examples

x <- sampleData[c("date","discharge")]
yearType = "water"
validate_data(x=x,yearType=yearType)

USGS-R/EflowStats documentation built on Sept. 30, 2023, 9:31 p.m.