library(tidyverse)
theme_set(theme_minimal())
library(performance)
library(ggrepel)
folha <- data.frame(
clube = c(
"Flamengo", "Corinthians", "Cruzeiro", "Palmeiras", "Atlético-MG",
"Santos", "Bahia", "Fluminense", "Grêmio", "São Paulo",
"Vasco", "Botafogo", "Athletico-PR", "Internacional", "Bragantino",
"Vitória", "Coritiba", "Mirassol", "Remo", "Chapecoense"
),
folha_salarial = c(
37.5, 30, 30, 30, 27,
25, 22, 20, 20, 18,
16, 15, 14, 12.5, 10,
9, 8, 6, 5.5, 3.8
)
)
classificacao <- data.frame(
clube = c(
"Flamengo", "Palmeiras", "Athletico-PR", "Fluminense", "Bahia",
"Cruzeiro", "Atlético-MG", "Santos", "Bragantino", "São Paulo",
"Coritiba", "Vitória", "Botafogo", "Vasco", "Mirassol",
"Corinthians", "Internacional", "Grêmio", "Remo", "Chapecoense"
),
P = c(64, 63, 53, 51, 49, 48, 47, 42, 40, 39, 39, 36, 36, 35, 33, 32, 32, 31, 25, 18),
J = c(30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29, 30, 30, 30, 30, 30, 29),
V = c(19, 18, 15, 14, 13, 14, 13, 11, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 5, 3),
E = c(7, 9, 8, 9, 10, 6, 8, 9, 7, 6, 9, 6, 9, 8, 9, 8, 11, 10, 10, 9),
D = c(4, 3, 7, 7, 7, 10, 9, 10, 12, 13, 11, 14, 12, 12, 13, 14, 12, 13, 15, 17),
GP = c(58, 52, 49, 48, 44, 46, 41, 46, 38, 35, 38, 33, 43, 36, 34, 31, 33, 32, 33, 30),
GC = c(25, 22, 35, 37, 36, 44, 35, 45, 35, 35, 48, 44, 48, 42, 44, 38, 38, 40, 48, 61),
SG = c(33, 30, 14, 11, 8, 2, 6, 1, 3, 0, -10, -11, -5, -6, -10, -7, -5, -8, -15, -31),
`%` = c(71, 70, 58, 56, 54, 53, 52, 46, 44, 43, 43, 40, 40, 40, 36, 35, 35, 34, 27, 20)
)
dados <- folha |> left_join(classificacao, by = "clube")
ggplot(dados, aes(x = folha_salarial * 1e6, y = P)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "orange", fill = "gray80") +
geom_label_repel(aes(label = clube), alpha = 0.7) +
scale_x_continuous(labels = scales::label_comma(big.mark = ".", decimal.mark = ",")) +
labs(x = "Folha Salarial (R$)", y = "Pontos no Brasileirão até 30ª Rodada",
caption = "Vasco e Chapecoense disputaram apenas 29 jogos até o momento")