library(ggplot2)
library(dplyr)
df %>%
group_by(year) %>%
summarise(people = mean(people)) %>%
ggplot(aes(year, people, fill = year)) +
geom_col() +
theme_linedraw()+
scale_fill_gradient(low = "pink", high = "blue") +
labs(x = "Год", y = "Среднее число сотрудников",
title = "Зависимость среднего числа сотрудников лабораторий от года") +
annotate(geom = "text", x = 2019, y = 4, label = "меньше всего")+
annotate(geom = "text", x = 2018, y = 4, label = "среднее")+
annotate(geom = "text", x = 2020, y = 4, label = "больше всего")+
theme(legend.position = "left")
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.
| Один | Два | Три |
|---|---|---|
| 1 | 2 | 3 |
| 1 | 2 | 3 |
| 1 | 2 | 3 |