gr_check_params {grwat} | R Documentation |
Check the correctness of parameters list for separating
Description
Check the correctness of parameters list for separating
Usage
gr_check_params(params, df = NULL)
Arguments
params |
|
df |
|
Value
stops the execution if anything is wrong and prints the exact reason of the error. Otherwise prints the message that everything is OK
Examples
library(grwat)
# example Spas-Zagorye data is included with grwat package
data(spas)
params = gr_get_params(reg = 'center')
gr_check_params(params)
# set the unknown parameter
params$new = -2
# use try if you do not want to stop at error
try(gr_check_params(params))
# remove wrong parameter
params$new = NULL
# remove right parameter
params$grad1 = NULL
try(gr_check_params(params))
# reset
params = gr_get_params(reg = 'center')
sep = gr_separate(spas, params, debug = TRUE)
parlist = attributes(sep)$params
parlist[['2002']]$grad1 = 4
# if the parlist is used for separation
# then data frame must be specified
try(gr_check_params(parlist))
gr_check_params(parlist, spas)
# grad parameter is not known
parlist[['2002']]$grad = 4
try(gr_check_params(parlist, spas))
# remove wrong parameter
parlist[['2002']]$grad = NULL
# remove year
parlist[['2002']] = NULL
try(gr_check_params(parlist, spas))
parlist[['2002']] = parlist[['2001']]
gr_check_params(parlist, spas)
[Package grwat version 0.0.4 Index]