Building Interactive Graphs with ggplot2 and Shiny

Build stunning graphics and interactive visuals for real-time data analysis and visualization with ggplot2 and Shiny
4.1 (12 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
116 students enrolled
82% off
Take This Course
  • Lectures 40
  • Length 1.5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 12/2014 English

Course Description

This course helps you move beyond the default graphics offered by R and shows you how to start making elegant and publication-ready plots. It equips you with a good command over ggplot 2 to build sophisticated and interactive graphs that suit your own data requirements.

This practical course shows you how to build statistical plots layer by layer by following along with the examples provided. You’ll first get familiar with the basics of ggplot2 by understanding the use of the building blocks of standard statistical plots and see how you can combine elements to make new graphics. Next, you’ll learn how to customize your graphs, and finally you’ll explore how to make interactive webpages to present your work or analyze your data.

About the Author

Christophe Ladroue has many years of experience in machine learning and statistics. Most of his work has been focused on developing tools for the analysis of biological data, from genetics to physiology, and his scientific publications span from medical journals to pure statistics. He has used and has been teaching R and ggplot2 for a few years and he occasionally posts related articles on his personal blog

What are the requirements?

  • Following an example-driven approach, this course offers a practical way to learn how to build interactive graphs with ggplot 2 and Shiny with the help of easy-to-understand examples and step-by- step instructions.

What am I going to get from this course?

  • Create interactive web pages and combine elements to produce sophisticated graphs
  • Make basic statistical plots (lines, paths, bar plots, histograms, and boxplots) with ggplot 2
  • Combine graphical elements and put more information on your plots
  • Address big data by plotting summary plots very quickly
  • Customize your plots to your own style and requirements
  • Understand reactive programming in Shiny for building interactive web pages
  • Get to grips with scoping and make your code more efficient
  • Publish and share your work

Who is the target audience?

  • If you are a software programmer, application developer, or web developer with basic to intermediate knowledge of R programming and you want to build elegant graphs to display data that you can showcase to your clients, this course is for you.
  • No knowledge of web technologies is required.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Getting Started with ggplot2

ggplot2 is not installed by default. A simple command allows you to install it. The free editor, RStudio, should also be installed. It'll be necessary when the manipulate package is presented.


ggplot2 plots do not rely on one plot function, but are built incrementally layer by layer.


Graphical elements can be controlled by either aesthetics or parameters. The difference can appear confusing at first.


A typical error when using ggplot2 is to use the concepts of mapping and setting aesthetics together. We clarify these two concepts with a simple example.


A ggplot object in a script will not produce a plot unless an explicit call to print() is made.

Section 2: Understanding Basic Plots

Data like quantity evolving through time are often presented with a connected line.


It's often of interest to draw paths on the plane, for example, to draw the movement of a particle.


Bar charts show the composition of your data against a certain criterion.


Histograms and density plots show the whole distribution of a quantity.


Boxplots show a visual summary of your data for easy comparison.

Section 3: Using Conditional Plots

Use more than two variables on your plot.


Use more than 2 variables on your plot.


Multiple data points having the same values hide each other. Move them about a bit to see them all.


Many graphs on one plot can be confusing. Put them all in their own subplots.


Many graphs on one plot can be confusing. Put them all in their own subplots.

Section 4: Using Statistics in Our Plot

It might be difficult to see a trend in the data with lots of points on a plot. Draw a fitting curve to see the trend more clearly.


Given what you know about the data, you might want to fit a specific model.


You might want to check the data against particular values. Add whichever function you want on top of the plot.


Very large datasets must be summarized before they are plotted. A dedicated package makes it very easy.


Extreme values are bound to occur in very large datasets and produce misleading plots. Learn how to remove them automatically.

Section 5: Customizing Your Graphs

Plot on a log scale. Investigate an extract of the plot.


Change the order of the variables to something more appropriate than the default.


Change the default colors to get a better contrast or convey an idea.


Change the default colors. Investigate only a range of values by using multiple gradients.


Customize the axis labels and the legend titles. Flip both axes to help readability.

Section 6: Shiny – Part 1

Create an interactive web page in R with Shiny. Firstly, install Shiny.


Understand how a Shiny app is structured.


Add textual reports to your webpage: free text, function outputs, and tables.


Shiny is based on the concept of reactive programming.


Control the updating of reports by using a submit button.

Section 7: Shiny – Part 2

A report can be composed of semantically different elements and can also get quite busy. Use tabs to separate parts of the reports and get a cleaner interface.


A good understanding of scoping can lead to great improvements in user experience.


If a user wants to, they can upload their own data to the Shiny app.


Suppose a user wants to save the results in a file. Add a Download button for such situations.


Let others use your interactive report on their machine, or share your report on the Internet.

Section 8: Putting Everything Together

Let the user explore their data with interactive plots and reports.


Let the user choose a variable and plot its evolution through time automatically.


Make a bubble chart in ggplot2. Turn it into a motion chart with Shiny.


Make the user interface adapt to different situations.


We have built the important components of our dashboard separately. Let's put them together.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Packt Publishing, Tech Knowledge in Motion

Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.

With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.

From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.

Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.

Ready to start learning?
Take This Course