Dropdown menus in R Markdown with bsselectR

December 14, 2016

[This article was first published on KYLE WALKER DATA, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I strongly believe that interactive reports, presentations, and scholarly articles are going to become much more prominent in the years ahead. Whereas a PDF article or presentation can often only show a limited aspect of a research project, interactive documents can allow a reader or presenter to explore project content in a much broader sense.

For dynamic research documents, an excellent option is to combine Shiny with R Markdown to generate a report that can execute R code from a Shiny server. However, not all interactive documents need the full power of Shiny. For example, I’m currently writing a report in which I’d like readers to be able to use drop-down menus to select charts to view. As I produced the charts in Python and saved them all to a folder, I don’t need Shiny to dynamically create the charts in the report.

To create the drop-down menu, I came across the bootstrap-select jQuery plugin. bootstrap-select adds Bootstrap’s dropdown.js and Bootstrap styling to re-style HTML

Most visited articles of the week

  1. 5 Ways to Subset a Data Frame in R
  2. How to write the first for loop in R
  3. An introduction to Causal inference
  4. How to perform a Logistic Regression in R
  5. R – Sorting a data frame by the contents of a column
  6. Date Formats in R
  7. Installing R packages
  8. How to install packages on R + screenshots
  9. Using apply, sapply, lapply in R


RSS Jobs for R users

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)