+ All Categories
Home > Documents > D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using...

D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using...

Date post: 07-Jun-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
32
DataCamp Building Dashboards with flexdashboard Incorporating Shiny into Dashboards BUILDING DASHBOARDS WITH FLEXDASHBOARD Elaine McVey Director of Quantitative Mobility TransLoc
Transcript
Page 1: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Incorporating Shiny intoDashboards

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Elaine McVeyDirector of Quantitative Mobility

TransLoc

Page 2: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Why should I add Shiny? Or not?

Why

Interactivity

Lightweight

Why not

Complication

Hosting

Page 3: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Why should I add Shiny? Or not?

Why

Interactivity

Lightweight

Why not

Complication

Hosting

Page 4: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Why should I add Shiny? Or not?

Why

Interactivity

Lightweight

Why not

Complication

Hosting

Page 5: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Why should I add Shiny? Or not?

Why

Interactivity

Lightweight

Why not

Complication

Hosting

Page 6: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

If not a Shiny app, then what?

A flexdashboard with Shiny is an interactive RMarkdown document

Page 7: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Making it shiny

runtime: shiny

Page 8: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Let's practice!

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Page 9: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

The Reactive DataframePattern

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Elaine McVeyDirector of Quantitative Mobility

TransLoc

Page 10: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Creating a sidebar

Column {data-width=200 .sidebar}

Page 11: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Creating a sidebar

Page 12: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Adding user inputs

Page 13: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Making our dataframe reactive

Page 14: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Using the reactive dataframe

Page 15: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Making dashboard components reactive

Page 16: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Steps to the reactive dataframe pattern

1. Create a sidebar column (using .sidebar).

2. Add user inputs to the sidebar (using xyzInput() Shiny widgets).

3. Make a "dataframe" that reacts to user inputs (using reactive()).

4. Replace the dataframe in the dashboard component code with the reactive

version.

5. Wrap each dashboard output with the appropriate Shiny version (renderXyz()).

Page 17: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Let's practice!

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Page 18: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Customized Inputs forCharts

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Elaine McVeyDirector of Quantitative Mobility

TransLoc

Page 19: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Chart-Specific Effects

Page 20: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Moving Inputs Into Charts

Page 21: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Moving Inputs Into Charts

Page 22: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Moving Inputs Into Charts

Page 23: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Moving Inputs Into Charts

Page 24: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Moving Inputs Into Charts

Page 25: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

A Shortcut

Page 26: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Let's practice!

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Page 27: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Course Recap

BUILDING DASHBOARDS WITH FLEXDASHBOARD

Elaine McVeyDirector of Quantitative Mobility

TransLoc

Page 28: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Resources

https://rmarkdown.rstudio.com/flexdashboard/

https://www.htmlwidgets.org/

Page 29: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Resources

https://rmarkdown.rstudio.com/flexdashboard/

https://www.htmlwidgets.org/

Page 30: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Resources

leaflet

DT (datatable)

plotly

highcharter

https://rmarkdown.rstudio.com/flexdashboard/

https://www.htmlwidgets.org/

Page 31: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

shinydashboard

Page 32: D a s h b o a r d s I n c o r p o r a ti n g S h i n y i n to...1. Create a sidebar column (using .sidebar). 2. Add user inputs to the sidebar (using xyzInput() Shiny widgets). 3.

DataCamp Building Dashboards with flexdashboard

Thank you!

BUILDING DASHBOARDS WITH FLEXDASHBOARD


Recommended