Skip to content
Snippets Groups Projects
Commit e2f9069d authored by Mario Garrido Tapias's avatar Mario Garrido Tapias
Browse files

Changes in functions

parent 0cde0901
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,6 @@ plotFor3SeasonsForPos <- function(data, variable) {
for (i in 1:3) {
season <- switch(i, ".1718", ".1819", ".1920")
var <- select(data, contains(paste(variable, season, sep = "")))
cat(names(var))
GK <- var %>% filter(str_detect(var[,1], 'GK'))
numGK <- dim(GK)[1]
DF <- var %>% filter(str_detect(var[,1], 'DF'))
......@@ -74,8 +73,8 @@ plotFor3SeasonsForPos <- function(data, variable) {
main= paste(c("Distribución posiciones ", season, "(TRAIN)"), sep = ""),
ylim = c(0, maxPInPos)
)
cat(dfs[[i]]$numberOf)
tabla <- table(rep(c("GK", "DF", "MF", "FW"), times = dfs[[i]]$numberOf))
cat(prop.table(tabla), "\n")
}
}
......@@ -128,7 +127,9 @@ titleForYAxis <- function(variable) {
fouls = "Faltas cometidas",
aerials_won_pct = "Porcenaje de balones aéreos ganados",
pens_att = "Penalties atajados",
shots_on_target_against = "Tiros a puerta en contra",
goals_against_per90_gk = "Goles en contra por 90 min (GK)",
saves = "Paradas totales",
save_pct = "Porcentaje de ocasiones paradas",
"Variable no encontrada")
return(title)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment