Intro to Visualization with R
Lesson 1 of 1
  1. 1
    Hello there! Today, we will be learning how to make visualizations with R’s popular ggplot2 package. You can create simple visualizations with base R, but we are c…
  2. 2
    When you learn grammar in school you learn about the basic units to construct a sentence. The basic units in the “grammar of graphics” consist of: + The data or the actual information you wish t…
  3. 3
    The first thing you’ll need to do to create a ggplot object is invoke the ggplot() function. Conceptualize this step as initializing the “canvas” of the visualization. In this step, it’s also stand…
  4. 4
    Before we go any further, let’s stop to understand when the data gets bound to the visualization: + Data is bound to a ggplot2 visualization by passing a data frame as the first argument in the gg…
  5. 5
    In the context of ggplot, aesthetics are the instructions that determine the visual properties of the plot and its geometries. Aesthetics can include things like the scales for the x and y axes, t…
  6. 6
    Before we teach you how to add aesthetics specific to a geom layer, let’s create our first geom! As mentioned before, geometries or geoms are the shapes that represent our data. In ggplot, there a…
  7. 7
    In the previous exercises, we added geoms to the plot and explored the idea of layers inheriting the original aesthetic mappings of the canvas. Sometimes, you’ll want individual layers to have thei…
  8. 8
    We’ve reviewed how to assign data-driven aesthetic mappings at the canvas level and at the geom level. However, sometimes you’ll want to change an aesthetic based on visual preference and not data….
  9. 9
    So far, we’ve reviewed how to add geometries to represent our data. We’ve also learned how to modify aesthetic values in our plot- whether those aesthetics are data-driven or assigned manually. Ano…
  10. 10
    We’ve gone over each of the basic units in the grammar of graphics: data, geometries, and aesthetics. Let’s extend this new knowledge to create a new type of plot: [the bar chart](https://ggplot2.t…
  11. 11
    You’ve completed the introduction to ggplot lesson! You’re ready to follow the general pattern for creating a visualization: 1. Determine what relationship you wish to explore in your data 2. Find…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo