Bring It All Together (Quarto)
This lesson is called Bring It All Together (Quarto), part of the Fundamentals of R course. This lesson is called Bring It All Together (Quarto), 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: R Survey Report
author: David Keyes
format: html
execute:
echo: false
warning: false
message: false
---
```{r}
library(tidyverse)
library(janitor)
library(scales)
```
```{r}
# Data from https://github.com/rstudio/r-community-survey
survey_data <-
read_tsv("2020-combined-survey-final.tsv") |>
clean_names()
```
```{r}
avg_r_enjoyment <-
survey_data |>
drop_na(qr_enjoyment) |>
group_by(qcountry) |>
summarize(
avg_enjoyment = mean(qr_enjoyment),
number_of_responses = n()
) |>
filter(number_of_responses >= 50) |>
arrange(desc(avg_enjoyment)) |>
drop_na(qcountry) |>
mutate(avg_enjoyment_formatted = number(avg_enjoyment, accuracy = 0.01))
```
# Introduction
This is a report on R enjoyment.
# Results
Here is a chart on average R enjoyment by country.
```{r}
ggplot(
data = avg_r_enjoyment,
mapping = aes(
x = avg_enjoyment,
y = qcountry,
label = avg_enjoyment_formatted
)
) +
geom_col(fill = "#6cabdd") +
geom_text(hjust = 1.2, color = "white") +
theme_minimal() +
labs(
title = "Average Enjoyment of R on a 5-Point Scale Among Users\nAround the World",
subtitle = "Only countries with 50 or more responses included",
x = NULL,
y = NULL
)
```
# Conclusion
I hope you enjoyed my report.
Learn More
The Quarto documentation website is a great place to learn more about Quarto. I also recommend the book, Quarto: The Practical Guide by Mine Çetinkaya-Rundel and Charlotte Wickham.
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.