Code Chunks
This lesson is called Code Chunks, part of the Fundamentals of R course. This lesson is called Code Chunks, part of the Fundamentals of R course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Loading transcript...
View code shown in video
---
title: My Penguins Report!
author: David Keyes
format: html
execute:
echo: false
warning: false
message: false
---
```{r}
library(tidyverse)
penguins <- read_csv("penguins.csv")
```
# Funders
1. The International Society of Penguin Enthusiasts and Waddle Admirers
1. The Coalition of People Who Are Definitely Not Anti-Penguin
1. The International Coalition for the Appreciation and Ethical Treatment of Penguins
They are **very** excited about this report and they *really* hope you are too.
# Introduction
This report is about **three** species of penguins
1. Adele
1. Gentoo
1. Chinstrap
You'll learn *so* much about the penguins. I hope you're ready!
## Results
Here is a chart showing the average bill length for penguins, grouped by island and sex.
```{r}
penguin_bill_length_by_island_and_sex <-
penguins |>
drop_na(sex) |>
group_by(island, sex) |>
summarize(mean_bill_length = mean(bill_length_mm))
ggplot(
data = penguin_bill_length_by_island_and_sex,
mapping = aes(
x = island,
y = mean_bill_length,
fill = sex
)
) +
geom_col(position = "dodge")
```
Learn More
To learn about the various options for code chunks, check out the Quarto website.
Have any questions? Put them below and we will help you out!
Course Content
33 Lessons
1
The Grammar of Graphics
04:36
2
Scatterplots
03:40
3
Histograms
04:51
4
Bar Charts
04:53
5
Setting color and fill Aesthetic Properties
02:43
6
Setting color and fill Scales
05:12
7
Setting x and y Scales
02:58
8
Adding Text to Plots
05:50
9
Plot Labels
02:59
10
Themes
02:10
11
Facets
02:56
12
Save Plots
02:49
13
Bring it All Together (Data Visualization)
06:14
You need to be signed-in to comment on this post. Login.