gr_check_data | R Documentation |
This function is called inside gr_separate()
, but can be used explicitly inside your code.
gr_check_data(df)
df |
|
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).
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.