Thoughts on Using Flexdashboard

r

Examples and Alternatives

Tony ElHabr https://twitter.com/TonyElHabr
2018-04-30

I’ve experimented with the {flexdashboard} package for a couple of things after first trying out not so long ago. In particular, I found the storyboard format to be my favorite. I used it to create the storyboard for tracking the activity of NBA team Twitter accounts.

Recently, I’ve been experimenting with the storyboard {flexdashboard} format for visualizing the weekly NFL picks that my brother and I do.

The Alternatives

In all, I have found {flexdashboard}s to be an extremely effective format. It functions as a good compromise among a number of different alternatives.

Some Other Opinions

Here’s a couple of my other thoughts and tips for using {flexdashboard}:

For example, I have used the following snippet of code to add functionality for a “toggle” button to show/hide code.

<script>
  $(".toggle").click(function() {
    $(this).toggleClass("open");
  });
</script>

When modifying a theme’s CSS, the typical/recommended approach is to use the browser’s “Inspect” tool (or some browser extension such as Selector Gadget to identify which specific styles to adjust.

For example, if the theme that is chosen for the {flexdashboard} (in particular, the storyboard format) uses the same styling for code and its output, the following CSS code can be used to distinguish the two.

pre.sourceCode.r {
  background-color: #ffffff;
}

To add to this technique, because the CSS files in the {flexdashboard} package, it’s not too difficult to simply pick out the file for the theme that is being used (see the resources/ folder in the package’s GitHub repo) and quickly identify what to modify.

Conclusion

As if I need to re-iterate it again, I would highly recommend trying out the {flexdashboard} package. If anything, you’ll learn that you don’t like it.


  1. These can also be be embedded into .html files knitted from a .Rmdfile, but I think that it’s more natural in the {flexdashboard} context. Also, I believe that the HTML format is the only standard .Rmd output format that has interactive capability, so other output formats cannot be used if opting for the knitr-Rmarkdown combo.↩︎

Citation

For attribution, please cite this work as

ElHabr (2018, April 30). Tony: Thoughts on Using Flexdashboard. Retrieved from https://itsmetoeknee.netlify.app/post/using-flexdashboard/

BibTeX citation

@misc{elhabr2018thoughts,
  author = {ElHabr, Tony},
  title = {Tony: Thoughts on Using Flexdashboard},
  url = {https://itsmetoeknee.netlify.app/post/using-flexdashboard/},
  year = {2018}
}