Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Z
zwemtijden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container 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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
swimming
zwemtijden
Commits
e5a1f2e7
Commit
e5a1f2e7
authored
2 years ago
by
Berinda van Dijk
Browse files
Options
Downloads
Patches
Plain Diff
Bugfixes, and rolled back some changed
parent
39cbb43f
Branches
Branches containing commit
No related tags found
1 merge request
!9
Removed some graphs, and multiple changes in line graphs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code.R
+31
-34
31 additions, 34 deletions
code.R
with
31 additions
and
34 deletions
code.R
+
31
−
34
View file @
e5a1f2e7
...
...
@@ -77,16 +77,15 @@ doId <- function(input) {
tabel_LastEntrys
<-
zonder_split
%>%
group_by
(
distance
,
stroke
)
%>%
filter
(
date
==
max
(
date
,
na.rm
=
TRUE
))
tabel_LastEntrys_beide
<-
zonder_split
%>%
group_by
(
distance
,
stroke
,
poolType
)
%>%
filter
(
date
==
max
(
date
,
na.rm
=
TRUE
))
tijdlijn_alles
<-
ggplot
(
zonder_split
,
aes
(
x
=
date
,
y
=
interaction
(
distance
,
stroke
,
sep
=
'm '
),
shape
=
poolType
))
+
geom_point
()
+
geom_point
(
data
=
tabel_Prs
,
color
=
"green"
,
alpha
=
0.7
,
size
=
2
,
show.legend
=
FALSE
)
+
labs
(
title
=
"Datum van alle gezwommen slagen per afstand"
,
y
=
'distance & stroke'
)
+
guides
(
color
=
'none'
)
+
scale_x_date
()
+
scale_y_discrete
(
limits
=
rev
)
tijdlijn_alles
<-
ggplotly
(
tijdlijn_alles
,
tooltip
=
c
(
'x'
,
'shape'
),
dynamicTicks
=
TRUE
)
labs
(
y
=
'distance & stroke'
)
+
guides
(
color
=
'none'
)
+
scale_x_date
()
+
scale_y_discrete
(
limits
=
rev
)
tijdlijn_alles
<-
ggplotly
(
tijdlijn_alles
,
tooltip
=
c
(
'x'
,
'shape'
),
dynamicTicks
=
TRUE
)
%>%
layout
(
title
=
list
(
text
=
paste0
(
'Datum van alle gezwommen slagen per afstand'
,
'<br>'
,
'<sup>'
,
'Green: last entrys'
,
'</sup>'
)))
appendPlotly
(
tijdlijn_alles
)
kleurentabel_prs
<-
ggplot
(
tabel_Prs
,
aes
(
distance
,
stroke
))
+
...
...
@@ -108,25 +107,29 @@ doId <- function(input) {
filter
(
points
==
max
(
points
,
na.rm
=
TRUE
))
%>%
filter
(
time
==
min
(
time
,
na.rm
=
TRUE
))
barplot_
uniform
<-
ggplot
(
tabel_Prs
,
aes
(
fill
=
distance
,
y
=
points
,
x
=
stroke
,
label
=
poolType
,
text
=
date
))
+
barplot_
original
<-
ggplot
(
tabel_Prs
,
aes
(
fill
=
distance
,
y
=
points
,
x
=
stroke
,
label
=
poolType
,
text
=
date
))
+
geom_col
(
position
=
position_dodge2
(
preserve
=
"single"
))
+
scale_fill_manual
(
values
=
kleurenset_afstanden
,
limits
=
force
)
+
labs
(
title
=
"Prs: Punten per afstand per slag. Zowel lange - als kortebaan."
)
barplot_original
<-
ggplotly
(
barplot_uniform
,
tooltip
=
c
(
'label'
,
'text'
,
'y'
))
%>%
labs
(
title
=
"Barplot_original -Prs"
)
barplot_original
<-
ggplotly
(
barplot_original
,
tooltip
=
c
(
'label'
,
'text'
,
'y'
))
%>%
layout
(
legend
=
list
(
orientation
=
'h'
),
dragmode
=
FALSE
)
appendPlotly
(
barplot_original
)
barplot_rotatedlabels
<-
barplot_uniform
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
barplot_rotatedlabels
<-
ggplot
(
tabel_Prs
,
aes
(
fill
=
distance
,
y
=
points
,
x
=
AfstandSlag
,
label
=
poolType
,
text
=
date
))
+
geom_col
(
position
=
position_dodge2
(
preserve
=
'single'
))
+
scale_fill_manual
(
values
=
kleurenset_afstanden
,
limits
=
force
)
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
+
labs
(
title
=
"Barplot_rotatedlabels- prs"
)
barplot_rotatedlabels
<-
ggplotly
(
barplot_rotatedlabels
,
tooltip
=
c
(
'label'
,
'text'
,
'y'
))
%>%
layout
(
dragmode
=
FALSE
)
appendPlotly
(
barplot_rotatedlabels
)
barplot_everydistance
<-
barplot_uniform
+
barplot_everydistance
<-
ggplot
(
tabel_Prs
,
aes
(
fill
=
distance
,
y
=
points
,
x
=
distance
,
label
=
poolType
,
text
=
date
))
+
geom_col
(
position
=
position_dodge2
(
preserve
=
'single'
))
+
scale_fill_manual
(
values
=
kleurenset_afstanden
,
limits
=
force
)
+
labs
(
title
=
"Barplot_everydistance- Prs"
)
+
facet_grid
(
cols
=
vars
(
stroke
),
space
=
'free_x'
)
barplot_everydistance
<-
ggplotly
(
barplot_everydistance
,
tooltip
=
c
(
'label'
,
'text'
,
'y'
))
%>%
layout
(
legend
=
list
(
orientation
=
'h'
),
dragmode
=
FALSE
)
barplot_everydistance
<-
ggplotly
(
barplot_everydistance
,
tooltip
=
c
(
'label'
,
'text'
,
'y'
))
%>%
layout
(
legend
=
list
(
orientation
=
'h'
),
dragmode
=
FALSE
)
appendPlotly
(
barplot_everydistance
)
tabel_LastEntrys
<-
zonder_split
%>%
...
...
@@ -146,19 +149,19 @@ doId <- function(input) {
stippenplot_plotly
<-
plot_ly
(
data
=
bovennul_sorted
,
x
=~
date
,
y
=~
points
,
type
=
'scatter'
,
mode
=
'markers'
,
color
=~
stroke
)
appendPlotly
(
stippenplot_plotly
)
stippenplot_sizes
<-
ggplot
(
bovennul_sorted
,
aes
(
x
=
date
,
y
=
points
,
color
=
stroke
,
size
=
distance
,
group
=
AfstandSlag
))
+
stippenplot_sizes
<-
ggplot
(
bovennul_sorted
,
aes
(
x
=
date
,
y
=
points
,
color
=
stroke
,
size
=
distance
,
group
=
AfstandSlag
))
+
geom_point
()
+
scale_color_manual
(
values
=
kleurenset_strokes
)
+
labs
(
title
=
"Punten >0 per datum per afstand"
)
stippenplot_sizes
<-
ggplotly
(
stippenplot_sizes
,
tooltip
=
c
(
'x'
,
'y'
,
'size'
))
appendPlotly
(
stippenplot_sizes
)
lijnenplot_ineen
=
ggplotly
(
ggplot
(
bovennul
,
aes
(
x
=
date
,
y
=
points
,
text
=
AfstandSlag
,
lijnenplot_ineen
=
ggplot
(
bovennul
,
aes
(
x
=
date
,
y
=
points
,
text
=
AfstandSlag
,
color
=
interaction
(
distance
,
stroke
,
sep
=
'm '
),
linetype
=
poolType
,
shape
=
poolType
))
+
labs
(
title
=
"Points, grouped by pooltype"
,
color
=
'Distance & stroke'
)
+
guides
(
shape
=
'none'
,
linetype
=
'none'
)
+
geom_line
()
+
geom_point
(),
tooltip
=
c
(
'date'
,
'points'
,
'text'
,
'shape'
))
geom_line
()
+
geom_point
()
lijnenplot_ineen
=
ggplotly
(
lijnenplot_ineen
,
tooltip
=
c
(
'date'
,
'points'
,
'text'
,
'shape'
))
naam_laatstgezien
=
''
for
(
i
in
1
:
length
(
lijnenplot_ineen
$
x
$
data
)){
goede_naam
=
substring
(
unlist
(
strsplit
(
lijnenplot_ineen
$
x
$
data
[[
i
]]
$
name
,
','
))[
1
],
2
)
...
...
@@ -170,21 +173,15 @@ doId <- function(input) {
naam_laatstgezien
=
goede_naam
}
appendPlotly
(
lijnenplot_ineen
)
lijnenplot_ineen_25m
<-
ggplot
(
bovennul
[
bovennul
$
poolType
==
'25m'
,],
aes
(
x
=
date
,
y
=
points
,
text
=
AfstandSlag
,
color
=
interaction
(
distance
,
stroke
,
sep
=
'm '
)))
+
labs
(
title
=
"Points - 25m pool"
)
+
geom_line
()
+
geom_point
()
+
labs
(
color
=
"Distance & stroke"
)
lijnenplot_ineen_25m
=
ggplotly
(
lijnenplot_ineen_25m
,
dynamicTicks
=
TRUE
,
tooltip
=
c
(
'x'
,
'y'
,
'text'
))
appendPlotly
(
lijnenplot_ineen_25m
)
lijnenplot_ineen_50m
<-
ggplot
(
bovennul
[
bovennul
$
poolType
==
'50m'
,],
aes
(
x
=
date
,
y
=
points
,
text
=
AfstandSlag
,
color
=
interaction
(
distance
,
stroke
,
sep
=
'm '
)))
+
labs
(
title
=
"Points - 50m pool"
)
+
geom_line
()
+
geom_point
()
+
labs
(
color
=
"Distance & stroke"
)
lijnenplot_ineen_50m
=
ggplotly
(
lijnenplot_ineen_50m
,
dynamicTicks
=
TRUE
,
tooltip
=
c
(
'x'
,
'y'
,
'text'
))
appendPlotly
(
lijnenplot_ineen_50m
)
for
(
pooltype_loop
in
c
(
'25m'
,
'50m'
)){
title_plot
=
paste
(
"Points - "
,
pooltype_loop
,
'pool'
)
lijnenplot_pooltype
=
ggplot
(
bovennul
[
bovennul
$
poolType
==
pooltype_loop
,],
aes
(
x
=
date
,
y
=
points
,
text
=
AfstandSlag
,
color
=
interaction
(
distance
,
stroke
,
sep
=
'm '
)))
+
labs
(
title
=
title_plot
,
color
=
"Distance & stroke"
)
+
geom_line
()
+
geom_point
()
lijnenplot_pooltype
=
ggplotly
(
lijnenplot_pooltype
,
dynamicTicks
=
TRUE
,
tooltip
=
c
(
'x'
,
'y'
,
'text'
))
appendPlotly
(
lijnenplot_pooltype
)
}
datumformat
=
"'%y"
for
(
pooltype
in
unique
(
zonder_split
$
poolType
)){
...
...
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