flexdashboard: Easy interactive dashboards for R
This article is originally published at https://www.rstudio.com/blog/
Today we’re excited to announce flexdashboard, a new package that enables you to easily create flexible, attractive, interactive dashboards with R. Authoring and customization of dashboards is done using R Markdown and you can optionally include Shiny components for additional interactivity.
Highlights of the flexdashboard package include:
Support for a wide variety of components including interactive htmlwidgets; base, lattice, and grid graphics; tabular data; gauges; and value boxes.
Flexible and easy to specify row and column-based layouts. Components are intelligently re-sized to fill the browser and adapted for display on mobile devices.
Extensive support for text annotations to include assumptions, contextual narrative, and analysis within dashboards.
Storyboard layouts for presenting sequences of visualizations and related commentary.
By default dashboards are standard HTML documents that can be deployed on any web server or even attached to an email message. You can optionally add Shiny components for additional interactivity and then deploy on Shiny Server or shinyapps.io.
Getting Started
The flexdashboard package is available on CRAN; you can install it as follows:
install.packages("flexdashboard", type = "source")
To author a flexdashboard you create an R Markdown document with the flexdashboard::flex_dashboard
output format. You can do this from within RStudio using the New R Markdown dialog:
Dashboards are simple R Markdown documents where each level 3 header (###
) defines a section of the dashboard. For example, here’s a simple dashboard layout with 3 charts arranged top to bottom:
---
title: "My Dashboard"
output: flexdashboard::flex_dashboard
---
### Chart 1
```{r}
```
### Chart 2
```{r}
```
### Chart 3
```{r}
```
You can use level 2 headers (-----------
) to introduce rows and columns into your dashboard and section attributes to control their relative size:
---
title: "My Dashboard"
output: flexdashboard::flex_dashboard
---
Column {data-width=600}
-------------------------------------
### Chart 1
```{r}
```
Column {data-width=400}
-------------------------------------
### Chart 2
```{r}
```
### Chart 3
```{r}
```
Learning More
The flexdashboard website includes extensive documentation on building your own dashboards, including:
A user guide for all of the features and options of flexdashboard, including layout orientations (row vs. column based), chart sizing, the various supported components, theming, and creating dashboards with multiple pages.
Details on using Shiny to create dashboards that enable viewers to change underlying parameters and see the results immediately, or that update themselves incrementally as their underlying data changes.
A variety of sample layouts which you can use as a starting point for your own dashboards.
Many examples of flexdashboard in action (including links to source code if you want to dig into how each example was created).
The examples below illustrate the use of flexdashboard with various packages and layouts (click the thumbnail to view a running version of each dashboard):
Try It Out
The flexdashboard package provides a simple yet powerful framework for creating dashboards from R. If you know R Markdown you already know enough to begin creating dashboards right now! We hope you’ll try it out and let us know how it’s working and what else we can do to make it better.
Thanks for visiting r-craft.org
This article is originally published at https://www.rstudio.com/blog/
Please visit source website for post related comments.