verify_ts | R Documentation |
Checks to see a given data.frame meets project criteria
verify_ts(data, var, checks = c("ncol", "nrow", "unitted", "tz", "units",
"names", "NA_values", "NA_dates", "timesteps"), on_fail = warning)
data |
a |
var |
optional name for timeseries. If supplied, will check variable column name |
checks |
tests to run on the data ('cols', 'tz', 'units', 'variable') |
on_fail |
function to call when a test fails. good options are warning and stop. if the function does not halt evaluation, FALSE is returned after the function is first called. |
TRUE if is valid, FALSE if not
## Not run:
files <- stage_nwis_ts(sites = c("nwis_06893820","nwis_01484680"), var = "doobs",
times = c('2014-01-01','2014-02-01'))
files <- download_ts("doobs_nwis", "nwis_01073389", on_local_exists="skip")
ts <- read_ts(files[1])
verify_ts(ts, var='doobs', checks=c('ncol','units','names')) # TRUE
verify_ts(ts, var='wtr', checks=c('ncol','units','names')) # warning + FALSE
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.