Skip to content

Instantly share code, notes, and snippets.

@henriquepgomide
Created September 21, 2019 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henriquepgomide/ff1cfd50de91079413e6dcad876bfe4d to your computer and use it in GitHub Desktop.
Save henriquepgomide/ff1cfd50de91079413e6dcad876bfe4d to your computer and use it in GitHub Desktop.
r
# Selecionar variáveis de interesse para análise de agrupamento
data <- cartola[, c("score_mean", "diff_home_away_s", "score_mean_home",
"score_mean_away", "shots_x_mean", "fouls_mean", "G_mean",
"RB_mean", "PE_mean", "A_mean", "I_mean", "FS_mean")]
names(data) <-
names(data) <- gsub("_mean", "", names(data))
data <- dummify(data)
# Plotar matriz de correlação
ggcorr(data, geom = "blank", label = TRUE, hjust = 0.75) +
geom_point(size = 10, aes(color = coefficient > 0, alpha = abs(coefficient) > 0.5)) +
scale_alpha_manual(values = c("TRUE" = 0.25, "FALSE" = 0)) +
guides(color = FALSE, alpha = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment