How to create a Flexdashboard: Exercises

[This article was first published on R-exercises, 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.


With flexdashboard, you can easily create interactive dashboards for R. What is amazing about it is that with R Markdown, you can publish a group of related data visualizations as a dashboard.

Additionally, it supports a wide variety of components, including htmlwidgets; base, lattice, and grid graphics; tabular data; gauges and value boxes and text annotations.

It is flexible and easy to specify rows and column-based layouts. Components are intelligently re-sized to fill the browser and adapted for display on mobile devices.

In combination with Shiny, you can create a high quality dashboard with interactive visualizations.

Before proceeding, please follow our short tutorial.

Look at the examples given and try to understand the logic behind them. Then, try to solve the exercises below by using R without looking at the answers. Then, check the solutions to check your answers.

Exercise 1

Create a new flexdashboard R Markdown file from the R console

Exercise 2

Create the very initial dashboard interface in a single column.

Exercise 3

Add the space in which you will put your first chart

Exercise 4

Add the space in which you will put your second chart. The two charts should be stacked vertically.

Exercise 5

Add a third chart with the same logic.

Exercise 6

Transform your layout to scrolling.

Exercise 7

Displays THE 3 charts split across two columns.

Exercise 8

Change the width of these two columns.

Exercise 9

Defines two rows instead of columns, the first of which has a single chart and the second of which has two charts:

Exercise 10

Change the height of these two columns.

To leave a comment for the author, please follow the link and comment on their blog: R-exercises. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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)