---
params: 
    title: ""
    Pars: "`r list()`"
    plotPars: "`r list()`"
    tabs: "`r TRUE`"
    its: " `r numeric()`"
    nyears: " `r numeric()`"
    proyears: " `r numeric()`"
    date: "`r Sys.Date()`"
title: "`r params$title`"
date: "`r params$date`"
output:
  html_document
---


```{r selectivity, echo=FALSE, results="asis"}
if (params$tabs) {
  cat('### Selectivity and Retention {.tabset .tabset-fade .tabset-pills}' )
} else {
  cat('### Selectivity and Retention')
}

dd <- params$Pars$M_ageArray %>% dim()
nsim <- dd[1]
maxage <- dd[2]

nsamp <- length(params$its)
```

#### Sampled Selectivity Parameters
Histograms of `r nsim` simulations of length at 5% selection (`L5`), first length at full selection (`LFS`), and vulnerability of animals at mean asymptotic length (`Vmaxlen`) for the first historical year, the last historical year, and the last projection year, wtih vertical colored lines indicating `r nsamp` randomly drawn values used in the other plots:

```{r selectivity_parameters, echo=FALSE}
MSEtool:::plot.Selectivity(params$Pars, nsamp=nsamp, plotPars=params$plotPars, plot.num=1)

```

#### Sampled Retention Parameters

Histograms of `r nsim` simulations of length at 5% retention (`LR5`), first length at full retention (`LFR`), and retention of animals at mean asymptotic length (`Rmaxlen`) for the first historical year, the last historical year, and the last projection year, wtih vertical colored lines indicating `r nsamp` randomly drawn values used in the other plots:

```{r retention_parameters, echo=FALSE}
MSEtool:::plot.Selectivity(params$Pars, nsamp=nsamp, plotPars=params$plotPars, plot.num=2) 
```

#### Selectivity & Retention at Length

```{r SR_at_length, echo=FALSE}
MSEtool:::plot.Selectivity(params$Pars, nsamp=nsamp, plotPars=params$plotPars, plot.num=3)

```

#### Selectivity & Retention at Age
```{r SR_at_age, echo=FALSE}
MSEtool:::plot.Selectivity(params$Pars, nsamp=nsamp, plotPars=params$plotPars, plot.num=4)
```


