Book description
Translate your data into info-graphics using popular packages in R
About This Book
- Use R's popular packages - such as ggplot2, ggvis, ggforce, and more - to create custom, interactive visualization solutions.
- Create, design, and build interactive dashboards using Shiny
- A highly practical guide to help you get to grips with the basics of data visualization techniques, and how you can implement them using R
Who This Book Is For
If you are looking to create custom data visualization solutions using the R programming language and are stuck somewhere in the process, this book will come to your rescue. Prior exposure to packages such as ggplot2 would be useful but not necessary. However, some R programming knowledge is required.
What You Will Learn
- Get to know various data visualization libraries available in R to represent data
- Generate elegant codes to craft graphics using ggplot2, ggvis and plotly
- Add elements, text, animation, and colors to your plot to make sense of data
- Deepen your knowledge by adding bar-charts, scatterplots, and time series plots using ggplot2
- Build interactive dashboards using Shiny.
- Color specific map regions based on the values of a variable in your data frame
- Create high-quality journal-publishable scatterplots
- Create and design various three-dimensional and multivariate plots
In Detail
R is an open source language for data analysis and graphics that allows users to load various packages for effective and better data interpretation. Its popularity has soared in recent years because of its powerful capabilities when it comes to turning different kinds of data into intuitive visualization solutions.
This book is an update to our earlier R data visualization cookbook with 100 percent fresh content and covering all the cutting edge R data visualization tools. This book is packed with practical recipes, designed to provide you with all the guidance needed to get to grips with data visualization using R. It starts off with the basics of ggplot2, ggvis, and plotly visualization packages, along with an introduction to creating maps and customizing them, before progressively taking you through various ggplot2 extensions, such as ggforce, ggrepel, and gganimate. Using real-world datasets, you will analyze and visualize your data as histograms, bar graphs, and scatterplots, and customize your plots with various themes and coloring options. The book also covers advanced visualization aspects such as creating interactive dashboards using Shiny
By the end of the book, you will be equipped with key techniques to create impressive data visualizations with professional efficiency and precision.
Style and approach
This book is packed with practical recipes, designed to provide you with all the guidance needed to get to grips with data visualization with R. You will learn to leverage the power of R and ggplot2 to create highly customizable data visualizations of varying complexities. The readers will then learn how to create, design, and build interactive dashboards using Shiny.
Table of contents
- Preface
- Installation and Introduction
-
Plotting Two Continuous Variables
- Introduction
- Plotting a basic scatterplot
- Hacking ggvis add_axis() function to operate as a title function
- Plotting a scatterplot with shapes and colors
- Plotting a shape reference palette for ggplot2
- Dealing with over-plotting, reducing points
- Dealing with over-plotting, jittering points
- Dealing with over-plotting, alpha blending
- Rug the margins using geom_rug()
- Adding marginal histograms using ggExtra
- Drawing marginal histogram using gridExtra
- Crafting marginal plots with plotly
- Adding regression lines
- Adding quantile regression lines
- Drawing publish-quality scatterplots
-
Plotting a Discrete Predictor and a Continuous Response
- Introduction
- Installing car package and getting familiar to data
- Drawing simple box plots
- Adding notches and jitters to box plots
- Drawing bivariate dot plots using ggplot2
- Using more suitable colors for geom_dotplot
- Combining box with dot plots
- Using point geometry to work as dots using ggvis, plotly and ggplot2
- Crafting simple violin plots
- Using stat_summary to customize violin plots
- Manually sorting and coloring violins
- Using joy package to replace violins
- Creating publication quality violin plots
-
Plotting One Variable
- Introduction
- Creating a simple histogram using geom_histogram()
- Creating an histogram with custom colors and bins width
- Crafting and coloring area plots using geom_area() and more
- Drawing density plots using geom_density()
- Drawing univariate colored dot plots with geom_dotplot()
- Crafting univariate bar charts
- Using rtweet and ggplot2 to plot twitter words frequencies
- Drawing publish quality density plot
-
Making Other Bivariate Plots
- Introduction
- Creating simple stacked bar graphs
- Crafting proportional stacked bar
- Plotting side-by-side bar graph
- Plotting a bar graphic with aggregated data using geom_col()
- Adding variability estimates to plots with geom_errrorbar()
- Making line plots
- Making static and interactive hexagon plots
- Adjusting your hexagon plot
- Developing a publish quality proportional stacked bar graph
-
Creating Maps
- Introduction
- Making simple maps - 1854 London Streets
- Creating an interactive cholera map using plotly
- Crafting choropleth maps using ggplot2
- Zooming in on the map
- Creating different maps based on different map projection types
- Handling shapefiles to map Afghanistan health facilities
- Crafting an interactive globe using plotly
- Creating high quality maps
- Faceting
-
Designing Three-Dimensional Plots
- Introduction
- Drawing a simple contour plot using ggplot2
- Picking a custom number of contour lines
- Using the directlabels package to label the contours
- Crafting a simple tile plot with ggplot2
- Creating simple raster plots with ggplot2
- Designing a three-dimensional plot with plotly
- Crafting a publication quality contour plot
- Using Theming Packages
- Designing More Specialized Plots
- Making Interactive Plots
- Building Shiny Dashboards
Product information
- Title: R Data Visualization Recipes
- Author(s):
- Release date: November 2017
- Publisher(s): Packt Publishing
- ISBN: 9781788398312
You might also like
book
R: Data Analysis and Visualization
Master the art of building analytical models using R About This Book Load, wrangle, and analyze …
book
R: Recipes for Analysis, Visualization and Machine Learning
Get savvy with R language and actualize projects aimed at analysis, visualization and machine learning About …
book
R for Data Science Cookbook
Over 100 hands-on recipes to effectively solve real-world data problems using the most popular R packages …
book
Applied Data Visualization with R and ggplot2
Develop informative and aesthetic visualizations that enable effective data analysis in less time Key Features Discover …