R Markdown documents are a perfect platform for interactive content. To make your documents interactive, add:
Learn more about packages that build htmlwidgets at www.htmlwidgets.org.
Use Shiny to run any R code that you like in response to user actions. Since web browsers cannot execute R code, Shiny interactions occur on the server side.
Learn more about Shiny at the Shiny Development Center.
If you include an interactive element in a static output format, like a PDF, R Markdown will embed a screenshot of the element.
Learn more about interactive documents with R Markdown at Interactive Documents.