---
title: "StepReg report"
output: html_document
date: today
params:
  modelParameters: NA
  modelVariables: NA
  modelSelection: NA
  selectionPlot: NA
  modelVote: NA
  relValue: NA
---

```{r include = FALSE}
knitr::opts_chunk$set(echo=FALSE)
library(ggplot2)
library(stringr)
library(flextable)
```

## {.tabset}

### Statistics

**Statistics of Variable Selection:**

```{r comment = NA}
qflextable(params$modelParameters)
qflextable(params$modelVariables)
params$modelSelection
strategies <- length(params$modelSelection)
nmetric <- length(params$modelSelection[[1]])
```

### Visualization

**Visualization of Variable Selection:**
```{r comment = NA, warning=FALSE, fig.width = 10, fig.height = 6 * nmetric}
for(i in names(params$selectionPlot)) {
  print(i)
  print(plot_grid(plotlist = c( rev(params$selectionPlot[[i]])), ncol = 1, rel_heights = c(1, as.numeric(params$relValue))))
}
```

### Model Vote

**Model Selection by Vote Across All Combinations of Strategy and Metric:**

```{r comment = NA}
qflextable(params$modelVote)
```