In this video, I show my students how to make a scatter plot in R with ggplot2. I go over how to make a basic scatter plot using Varieties of Democracy data. Then I show how to add dimensions with color and size, how to add a trend (regression) line, how to facet wrap and finally how to label points.
Data: github.com/ete...
Table of Contents:
00:06 - Marker 4
00:45 - Prep the Quarto document
01:23 - Read in the data
04:47 - Make a scatter plot
05:58 - Prevent warnings from appearing
06:52 - Stretching the x-axis on a log scale
08:06 - Using the scales package
10:46 - Add third dimension with color =
12:16 - Add fourth dimension with size =
13:48 - Add a trend line
18:50 - Facet wrapping
21:20 - add free scales to facet_wrap() call
22:45 - Labeling points
Негізгі бет Make a Scatter Plot with ggplot2
Пікірлер: 1