Learn R Programming

grwat (version 0.1)

gr_to_pardf: Convert list of parameters to data frame

Description

Convert list of parameters to data frame

Usage

gr_to_pardf(params)

Value

tibble data frame with tabular representation of hydrograph separation parameters

Arguments

params

list of lists of hydrograph separation parameters as returned in params attribute by gr_separate() with debug = TRUE.

Examples

Run this code
library(grwat)

data(spas) # example Spas-Zagorye data is included with grwat package
head(spas)

# separate
sep = gr_separate(spas, params = gr_get_params(reg = 'center'))

# Visualize
gr_plot_sep(sep, c(1978, 1989)) 

# Debug mode gives access to additional information
sep_debug = gr_separate(spas, 
                        params = gr_get_params(reg = 'center'), 
                        debug = TRUE)

# a vector of years with jittered params
jit = attributes(sep_debug)$jittered
print(jit)

# actual params used for each year
parlist = attributes(sep_debug)$params

# tweak parameters for selected year
parlist[['1989']]$grad1 = 3
parlist[['1989']]$grad2 = 6

# tabular representation of parameters
partab = gr_to_pardf(parlist)

head(partab)

partab |> 
  dplyr::filter(year == 1989) |> 
  head()

Run the code above in your browser using DataLab