Book Image

Applied Data Visualization with R and ggplot2

By : Dr. Tania Moulik
Book Image

Applied Data Visualization with R and ggplot2

By: Dr. Tania Moulik

Overview of this book

Applied Data Visualization with R and ggplot2 introduces you to the world of data visualization by taking you through the basic features of ggplot2. To start with, you’ll learn how to set up the R environment, followed by getting insights into the grammar of graphics and geometric objects before you explore the plotting techniques. You’ll discover what layers, scales, coordinates, and themes are, and study how you can use them to transform your data into aesthetical graphs. Once you’ve grasped the basics, you’ll move on to studying simple plots such as histograms and advanced plots such as superimposing and density plots. You’ll also get to grips with plotting trends, correlations, and statistical summaries. By the end of this book, you’ll have created data visualizations that will impress your clients.
Table of Contents (10 chapters)

Chapter 2. Grammar of Graphics and Visual Components

In this chapter, we will explore the concept of the Grammar of Graphics in detail and use it to customize graphs to create better visualizations.

We need to customize graphs because default graphs may have fonts that are not visible in a presentation or document, or have scales that do not convey much information about the data. Sometimes, a company may require a uniform style for all their graphs to distinguish themselves, in which case, you would need to define and use the same style for all graphs. We may also need to split data into different subsets in order to understand it in greater detail. This chapter will explore these aspects in detail and explain how to change the default structure of a graph.

By the end of this chapter, you will be able to:

  • Apply the Grammar of Graphics techniques to layers, scales, and coordinates
  • Utilize faceting to make multiplots and divide data into subplots
  • Utilize colors in plots effectively
  • Modify the appearance...