powered by
Ensures a minimal set of columns exists in the dataset; otherwise throws an error listing the missing names.
validate_wq( df, required = c("ph", "turbidez", "od", "dbo", "nt_total", "p_total", "tds", "temperatura", "coliformes"), nd_policy = c("ld2", "ld", "zero", "na") )
The input df if valid; otherwise, an error is thrown.
df
Input data.frame/tibble to validate.
Character vector of required column names to check for.
Policy for censored values (ND/<LD/<LOQ) when required columns are not numeric. One of:
"ld2" (default): use half the detection limit
"ld" : use the detection limit
"zero" : replace with 0
"na" : replace with NA
read_wq(), conama_check()
read_wq()
conama_check()
df_ex <- data.frame( ph = 7, turbidez = 2, od = 7, dbo = 3, nt_total = 0.8, p_total = 0.05, tds = 150, temperatura = 24, coliformes = 200 ) validate_wq(df_ex)
Run the code above in your browser using DataLab