Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GMTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
margarr
GMTool
Commits
3e026a20
Commit
3e026a20
authored
May 24, 2022
by
Mario Garrido Tapias
Browse files
Options
Downloads
Patches
Plain Diff
Density plot for 3 season
parent
58b6cbad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
UnivariateAnalysis.R
+33
-3
33 additions, 3 deletions
UnivariateAnalysis.R
with
33 additions
and
3 deletions
UnivariateAnalysis.R
+
33
−
3
View file @
3e026a20
...
...
@@ -3,6 +3,21 @@ setwd("/home/mariogt/TFGs/Estadistica/")
#####################################
# FUNCIONES #
#####################################
distBarFor3Season
<-
function
(
data
,
variable
)
{
age
<-
c
()
for
(
i
in
1
:
3
)
{
season
<-
switch
(
i
,
".1718"
,
".1819"
,
".1920"
)
var
<-
unname
(
select
(
data
,
contains
(
paste
(
variable
,
season
,
sep
=
""
))))
n
<-
dim
(
var
)[
1
]
colnames
(
var
)
<-
"Age"
age
<-
rbind
(
age
,
var
)
}
df
<-
data.frame
(
age
,
rep
(
c
(
"17-18"
,
"18-19"
,
"19-20"
),
times
=
rep
(
n
,
times
=
3
)))
colnames
(
df
)
<-
c
(
"edad"
,
"temporada"
)
ggplot
(
df
,
aes
(
x
=
edad
,
fill
=
temporada
))
+
geom_density
(
alpha
=
0.5
)
}
distBarFor3Season
(
train
,
"age"
)
# Histograms for all seasons for the variable entered by parameter.
barpFor3Season
<-
function
(
data
,
variable
)
{
par
(
mfrow
=
c
(
1
,
3
))
...
...
@@ -139,15 +154,27 @@ ids <- t(ids)
########
# Edad #
########
# Distribucion (Gráficos de barras)
distBarFor3Season
(
train
,
"age"
)
# Box plots
##########
# Altura #
##########
# Distribucion (Gráficos de barras)
distBarFor3Season
(
train
,
"height"
)
# Box plots
################
# Pierna buena #
################
# Distribución (Grafico de tarta)
foot
<-
train
%>%
select
(
"foot.1718"
)
library
(
lessR
)
PieChart
(
foot.1718
,
hole
=
FALSE
,
values
=
"%"
,
data
=
foot
,
main
=
"Distribución de pierna dominante"
,
fill
=
brewer.pal
(
3
,
"Set1"
),)
##################################
# Goles y asistencias por 90 min #
##################################
##################################.
distBarFor3Season
(
train
,
"goals_assists_per90"
)
univariantAnalysis
(
train
,
"goals_assists_per90"
,
ids
)
######
# xG #
...
...
@@ -164,7 +191,7 @@ ids <- t(ids)
##################################
# Porcentaje de tiros a porteria #
##################################
# univariantAnalysis(train, "xa", ids)
#######################
# Porcentaje de pases #
#######################
...
...
@@ -197,9 +224,11 @@ ids <- t(ids)
####################################
# Porcentaje de presiones exitosas #
####################################
# univariantAnalysis(train, "xa", ids)
##################################
# Porcentaje de regates exitosos #
##################################
# univariantAnalysis(train, "xa", ids)
####################
# Faltas cometidas #
####################
...
...
@@ -207,6 +236,7 @@ ids <- t(ids)
#######################################
# Porcentaje de juegos aereos ganados #
#######################################
# univariantAnalysis(train, "xa", ids)
######################
# Penalties atajados #
######################
...
...
@@ -218,7 +248,7 @@ ids <- t(ids)
###################################
# Porcentaje de ocasiones paradas #
###################################
univariantAnalysis
(
train
,
""
)
#
univariantAnalysis(train, "")
laLigaPlayers
$
foot
<-
as.factor
(
laLigaPlayers
$
foot
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment