gr_check_data {grwat} | R Documentation |
Check the correctness of data frame for separating
Description
This function is called inside gr_separate()
, but can be used explicitly inside your code.
Usage
gr_check_data(df)
Arguments
df |
|
Value
stops execution if df
contains the wrong number of columns, or the columns have the wrong types, or the data in columns is incorrect (e.g. runoff or precipitation are negative).
Examples
library(grwat)
# example Spas-Zagorye data is included with grwat package
data(spas)
head(spas)
gr_check_data(spas)
# raw Spas-Zagorye data represents date components
# in columns and does not contain meteorologgical variables
path = system.file("extdata", "spas-zagorye.txt",
package = "grwat")
hdata_raw = read.delim(path, header = FALSE,
sep = ' ', na.strings = c('-999', '-999.0', '-'),
col.names = c('d', 'm', 'y', 'q'))
print(hdata_raw)
try(gr_check_data(hdata_raw))
[Package grwat version 0.0.4 Index]