Create parameters using params attribute inside Rmarkdown script.
Example -
---
title: "Rmarkdown Parameters"
output: html_document
params:
data: mpg
---
To use parameter in Rmarkdown script, go to knit and click on knit with parameters, then type the parameter value and press enter.
To use parameter inside r script, type the pramteer variable preceded with params$ to use it.
Such as `r params$data`
The parameter is applied in Rmarkdown script and then shows a html page.