Reader small image

You're reading from  Data Wrangling with R

Product typeBook
Published inFeb 2023
PublisherPackt
ISBN-139781803235400
Edition1st Edition
Concepts
Right arrow
Author (1)
Gustavo R Santos
Gustavo R Santos
author image
Gustavo R Santos

Gustavo R Santos has worked in the Technology Industry for 13 years, improving processes, and analyzing datasets and creating dashboards. Since 2020, he has been working as a Data Scientist in the retail industry, wrangling, analyzing, visualizing and modeling data with the most modern tools like R, Python and Databricks. Gustavo also gives lectures from time to time at an online school about Data Science concepts. He has a background in Marketing, is certified as Data Scientist by the Data Science Academy Brazil and pursues his specialist MBA in Data Science at the University of São Paulo
Read more about Gustavo R Santos

Right arrow

Facet grids

Facet grids create a figure in the form of a matrix of rows and columns to plot multiple graphics side by side. Those graphics are subplots of one or more variables, facilitating the visualization of the relationship of a variable with others separately. In summary, facet grids show small plots representing a subgroup of the data.

We can see what a facet grid looks like using the diamonds dataset, which is built into ggplot2 (type ?diamonds into R’s console for the documentation). This data has the cuts, dimensions, colors, prices, and other attributes of 54,000 diamonds. If we want to see a scatterplot of the prices by carat, the graphic will look busy, as we can see in Figure 11.1. Notice that it is difficult to see the trends and relationships for each cut type, such as Fair or Good. They will be hidden under other points. What we see is the general trend and relationship for the entire dataset.

Figure 11.1 – Scatterplot of...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Data Wrangling with R
Published in: Feb 2023Publisher: PacktISBN-13: 9781803235400

Author (1)

author image
Gustavo R Santos

Gustavo R Santos has worked in the Technology Industry for 13 years, improving processes, and analyzing datasets and creating dashboards. Since 2020, he has been working as a Data Scientist in the retail industry, wrangling, analyzing, visualizing and modeling data with the most modern tools like R, Python and Databricks. Gustavo also gives lectures from time to time at an online school about Data Science concepts. He has a background in Marketing, is certified as Data Scientist by the Data Science Academy Brazil and pursues his specialist MBA in Data Science at the University of São Paulo
Read more about Gustavo R Santos