View source: R/validate_data.R
validate_data | R Documentation |
Function to check dataframe inputs for appropriate data classes and screen for missing values.
validate_data(x, yearType, wyMonth = 10L)
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. |
Checks performed ensure the data is valid for use with other EflowStats functions. #'
First column must be of class 'Date'.
Second must be of class 'numeric'.
'yearType' input must be either "water" or "calendar".
Every year as defined by the 'yearType' input must be complete.
data.frame with rows sorted by date. Boolean FALSE if data is not found to be valid. (See details)
x <- sampleData[c("date","discharge")]
yearType = "water"
validate_data(x=x,yearType=yearType)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.