Plotting¶
Learning outcomes
- Comfortable with the first chapter of R for Data Science
- Can use
ggplot2
for simple plots - Can create simple ggplots from tidy data
- Can use some ggplot aesthetics
- Can use some ggplot geometrical objects
For teachers
Teaching goals are:
- Learners have read part of the first chapter of R for Data Science
- Learners have created simple plots in
ggplot2
- Learners can create simple ggplots from tidy data
- Learners can set the aesthetics
x
,y
andcolor
- Learners can use
geom_scatter
,geom_boxplot
andgeom_smooth
for simple aesthetics
Prior question:
- What is the most used use R package for plotting?
- What is
gg
inggplot2
? - What is tidy data?
- There is a philosophy that 'missing values should never silently go missing'. What does that mean?
Feedback questions:
- What is
gg
inggplot2
? - What is tidy data?
- What is an aesthetic?
- What is a
geom
? - The philosophy that 'missing values should never silently go missing'. What does this mean?
Why ggplot2
is important¶
ggplot2
allows you to create publication-quality graphs for your paper,
using a unified (and extensible) grammar,
which allows you to express your unique
plotting needs.
Exercises¶
Exercise 1¶
- Read R for data science, chapter 1 until the exercises of 1.2.5
- Do these exercises
(optional) Exercise 2¶
- Read R for data science, chapter 1 until the exercises of 1.4.3.
- Do these exercises
(optional) Exercise 3¶
- Read R for data science, chapter 1 until the exercises of 1.5.5
- Do these exercises
(optional) Exercise 4¶
- Read R for data science, chapter 1 until the exercises of 1.6.1
- Do these exercises