library(tidyverse)

Задание 1

Посмотрим на названия столбцов:

colnames(chickwts)
## [1] "weight" "feed"

Воспроизведем график из задания 1:

ggplot(data = chickwts, aes(x = feed, y = weight, fill = feed)) + 
  geom_boxplot() +
  labs(title = "Weights of chicken by feed type", 
       x = "Type of feed", y = "Chicken weight") +
  scale_fill_discrete(name = "Type of feed")

Задание 2

Посмотрим на названия столбцов:

colnames(iris)
## [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "Species"

Воспроизведем график из задания 2:

ggplot(data = iris, aes(x = Sepal.Length, fill = Species)) + 
  geom_density() + facet_wrap(~Species) +
  scale_fill_manual(values = c("red", "orange", "yellow"))

Задание 3

Посмотрим на названия столбцов:

colnames(iris)
## [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "Species"

Воспроизведем график из задания 3:

ggplot(data = iris, aes(x = Sepal.Length, y = Petal.Length,
                        color = Species)) + 
  geom_point() + geom_smooth(method = lm)
## `geom_smooth()` using formula 'y ~ x'