# Flood Frequency Analysis

Approach: `r params$modelling_assumptions$approach`

```{r, include = FALSE}
assumptions <- params$modelling_assumptions

if (length(assumptions$ns_splits) > 0) {
	splits <- paste0(assumptions$ns_splits, collapse = ", ")
} else {
	splits <- "None"
}
```

Split Point(s): `r splits`

Model Structures:

```{r, echo = FALSE}
period_labels <- vapply(
	Filter(function(x) x$name == "Model Assessment", params$submodule_results), 
	function(submodule) sprintf("%d-%d", submodule$start, submodule$end), 
	character(1)
)

trend_location <- vapply(
	assumptions$ns_structures,
	function(structure) structure$location, 
	logical(1)
)

trend_scale <- vapply(
	assumptions$ns_structures,
	function(structure) structure$scale,
	logical(1)
)

# Combine into a data frame
period_df <- data.frame(
  Subperiod = period_labels,
  `Trend in Location` = trend_location,
  `Trend in Scale` = trend_scale,
  check.names = FALSE
)

# Render the table
knitr::kable(period_df, format = "markdown", align = "lcc")
```


