Description Usage Format Details References Examples
A dataset containing information about free, reduced and full priced lunches.
1 |
A data frame with 47 rows and 4 variables
year. Year
free. Number of students getting free lunch
reduced. Number of students getting reduced price lunch
full. Number of students paying full price for lunch
https://catalog.data.gov/dataset/national-school-lunch-assistance-program-participation-and-meals-served-data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
library(tidyverse)
library(ggrepel)
lunches %>%
gather(type, students, -year) %>%
group_by(year) %>%
mutate(prop = students/sum(students)) %>%
ggplot(aes(year, prop, color = type, group = type)) +
geom_text(
data = lunches %>%
gather(type, students, -year) %>%
group_by(year) %>%
mutate(prop = students/sum(students)) %>%
filter(year == 2017),
aes(label = type),
hjust = 0, size = 5
) +
geom_line(size = 1) +
theme_minimal() +
theme(legend.position = 'none') +
scale_x_continuous(limits = c(1970, 2023), breaks = seq(1970, 2010, by = 10)) +
scale_y_continuous(labels = scales::percent)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.