library(tidyverse)
## -- Attaching packages ------------------------------------------------ tidyverse 1.3.0 --
## v ggplot2 3.3.1 v purrr 0.3.4
## v tibble 3.0.0 v dplyr 1.0.0
## v tidyr 1.1.0 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.5.0
## -- Conflicts --------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
## Ambil raw data CSV dari footystats.org. Filter hanya GK yang pernah bermain
pemain <- read.csv(file.choose(), header = T)
GK2 <- pemain %>%
filter(position == "Goalkeeper") %>%
filter(appearances_overall != 0)
plot <- ggplot(GK2, aes(conceded_overall, full_name)) +
geom_col() +
theme(axis.text = element_text(size = 24),
axis.title = element_text(size = 24),
legend.text = element_text(size = 24),
legend.title = element_text(size = 24)) +
scale_x_continuous() +
labs(title="Performa Penjaga Gawang Liga Inggris",
caption="footystat.org",
x="Jumlah Kebobolan Keseluruhan",
y="Nama Penjaga Gawang") +
theme_classic()
print(plot)
## Melihat jumlah kebobolan per pertandingan
plot2 <- ggplot(GK2, aes(conceded_per_90_overall, full_name)) +
geom_col() +
theme(axis.text = element_text(size = 24),
axis.title = element_text(size = 24),
legend.text = element_text(size = 24),
legend.title = element_text(size = 24)) +
scale_x_continuous() +
labs(title="Performa Penjaga Gawang Liga Inggris",
caption="footystat.org",
x="Jumlah Kebobolan per 90 menit",
y="Nama Penjaga Gawang") +
theme_classic()
print(plot2)
plot3 <- ggplot(GK2, aes(age, conceded_per_90_overall)) +
geom_smooth(method=lm) +
theme(axis.text = element_text(size = 24),
axis.title = element_text(size = 24),
legend.text = element_text(size = 24),
legend.title = element_text(size = 24)) +
scale_x_continuous() +
labs(title="Performa Penjaga Gawang Liga Inggris",
caption="footystat.org",
x="Usia",
y="Jumlah Kebobolan per 90 menit") +
theme_classic()
print(plot3)
## `geom_smooth()` using formula 'y ~ x'