title: Parameterized RMarkdown does not filter parameter in R
body: <p>I am testing to use parameterized RMarkdown, using c as a parameter. I am using <code>Knit with parameters</code> choosing <code>a</code> or <code>b</code>, or nothing which by default chooses <code>a</code>.
  I expect to obtain 2 or 5 as the mean but I always obtain 3.5 which is the global mean.
  What am I doing wrong here?</p>
  <pre><code>---
  title: &quot;Parameterized RMarkdown&quot;
  output:
    html_document: default
  params:
    c: &quot;a&quot;
  ---
  
  ```{r setup, include=FALSE}
  knitr::opts_chunk$set(echo = TRUE)
  library(tidyverse)
  library(knitr)
  ```
  
  
  ```{r mean, echo=FALSE}
  df &lt;- tibble(c = c(&quot;a&quot;, &quot;a&quot;, &quot;a&quot;, &quot;b&quot;, &quot;b&quot;, &quot;b&quot;),
               x = c(1, 2, 3, 4, 5, 6))
  mean(df$x)
  ```
  </code></pre>