Programmieren lernen
PacmanÜber mich
English
English
  • Course Outline
  • 1 - Databricks
    • Getting Started
    • Working with Notebooks
      • Adding Documentation
      • Built-In Visualizations
      • Import Data
      • Export Data
  • 2 - Introduction
    • Types of Questions
      • Finding Individual Records
      • Summarizing Data
      • Exploring Data
      • Drawing Inferences From Data
      • Predicting Information
      • Finding Causality
    • Steps in Data Analytics
    • Dimensions of Data Sets
    • Dimensions of Records
    • Dimensions of Fields
    • Data Types and Scales
  • 3 - SQL
    • Basic SQL
      • What is SQL?
      • Import Data
      • Select Columns
      • Filter Rows
      • Aggregate and Group Rows
      • Filter Aggregated Rows
      • Sort Rows
    • Advanced SQL
      • Views
      • Set Operators
      • Subqueries
      • Window Functions
      • Date and Time
      • Arrays
      • JSON
      • Statistical Analysis
    • Multiple Data Sets with SQL
    • Text with SQL
      • Search Text
      • Analyzing Words
        • Prefilter the Data
        • Clean and Normalize
        • Tokenize and Count
        • Filter Stop Words
        • POS Tagging
      • Word Pairs
      • Extract Emoticons
  • 4 - Python
    • Python for Data Analytics
      • What is Python?
    • Natural Language Processing
  • 5 - R
    • R Basics
  • 6 - Visualization
    • Why Visualize Data?
    • Data Visualization with R
    • Types of Visualizations
      • Developments and Trends
      • Distributions
    • Pitfalls in Data Visualization
  • 7 - Tableau
    • Getting Data Into Tableau
  • 8 - Spreadsheets
    • What Is A Spreadsheet?
  • Data & Exercises
    • Simpsons
    • Covid19
    • TED Talks
    • Lemonade Market Research
    • Chicago Crimes
    • Tweets of German Politicians
    • Amazon Product Reviews
    • REWE Online Products
Powered by GitBook
On this page
  • The ggplot2 Library
  • The Grammar of Graphics
  • Cheat Sheet
  • References

Was this helpful?

  1. 6 - Visualization

Data Visualization with R

PreviousWhy Visualize Data?NextTypes of Visualizations

Last updated 4 years ago

Was this helpful?

The ggplot2 Library

One of the most proficient libraries for data visualization with R is ggplot2. In fact, the library is the reason why I prefer using R for more advanced visualizations that go beyond the capabilities of the Databricks standard features.

The Grammar of Graphics

ggplot2 is based on . If you have never heard of ggplot2 or the grammar of graphics, read this fantastic introduction by Bradley Boehmke from the University of Cincinnati. He is also the author of the book :

The grammar [..] suggests the high-level aspects of a plot that can be changed, giving you a framework to think about graphics, and hopefully shortening the distance from mind to paper [3].

Cheat Sheet

If you want to dive deeper, I recommend the book ggplot2: Elegant Graphics for Data Analysis. for which the 3rd edition soon to be published by Springer is available online:

References

  • [1] Boehmke, Ph D. Data Wrangling with R. 1st ed. 2016, Springer International Publishing : Imprint: Springer, 2016.

In brief, the grammar tells us that a graphic maps the data to the aesthetic attributes (colour, shape, size) of geometric objects (points, lines, bars). The plot may also include statistical transformations of the data and information about the plot’s coordinate system. Facetting can be used to plot for different subsets of the data. The combination of these independent components are what make up a graphic [].

On the , a development environment for the R language, you find a useful 2-page cheat sheet for the most important commands in ggplot2:

[2] Wickham, Hadley, and Garrett Grolemund. R for Data Science: Import, Tidy, Transform, Visualize, and Model Data. First edition, O’Reilly, 2016. Online:

[3] Wickham, Hadley. Ggplot2. Springer Science+Business Media, LLC, 2016. Preprint of 3rd edition online:

3
GitHub account of the popular RStudio
https://r4ds.had.co.nz/index.html
https://ggplot2-book.org/
the grammar of graphics
Data Wrangling with R
An Introduction to `ggplot2` · UC Business Analytics R Programming Guide
cheatsheets/data-visualization-2.1.pdf at main · rstudio/cheatsheetsGitHub
Welcome | ggplot2
Logo
Logo