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
a97e9aa0
Commit
a97e9aa0
authored
1 year ago
by
Berinda van Dijk
Browse files
Options
Downloads
Patches
Plain Diff
Some changes in code format, and every city now starts with an uppercase letter.
parent
e04e0bca
Branches
Branches containing commit
No related tags found
1 merge request
!13
Support for laptimes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code.R
+12
-10
12 additions, 10 deletions
code.R
with
12 additions
and
10 deletions
code.R
+
12
−
10
View file @
a97e9aa0
...
...
@@ -41,11 +41,13 @@ doId <- function(input) {
bron
$
poolType
<-
as.factor
(
bron
$
poolType
)
bron
=
bron
[
order
(
bron
$
stroke
,
bron
$
distance
),]
bron
$
AfstandSlag
<-
factor
(
bron
$
AfstandSlag
,
ordered
=
TRUE
,
levels
=
unique
(
bron
$
AfstandSlag
))
#Wat als iets niet in kleurenset_afstanden valt?
kleurenset_afstanden
=
c
(
'25'
=
'red'
,
'50'
=
'orange'
,
'100'
=
'yellow'
,
'200'
=
'green'
,
'400'
=
'blue'
,
'800'
=
'purple'
,
'1500'
=
'deeppink1'
,
'500'
=
'black'
)
kleurenset_strokes
=
c
(
'Backstroke'
=
'red'
,
"Breaststroke"
=
'orange'
,
"Butterfly"
=
"purple"
,
"Freestyle"
=
"green"
,
"Medley"
=
"blue"
)
kleurenset_pooltypes
=
c
(
'25m'
=
'orchid'
,
'50m'
=
'cornflowerblue'
,
'OW'
=
'limegreen'
)
kleurenset_Pbs
=
c
(
'Pb'
=
'maroon1'
,
'noPb'
=
'black'
)
bron
=
separate
(
bron
,
col
=
heatType
,
into
=
c
(
"hoofdafstand"
,
"heatType"
),
sep
=
", "
,
fill
=
'left'
)
bron
$
heatType
<-
as.factor
(
bron
$
heatType
)
...
...
@@ -72,6 +74,7 @@ doId <- function(input) {
bron
<-
separate
(
bron
,
col
=
'city'
,
into
=
c
(
"MeetId"
,
'city'
),
sep
=
" - "
)
bron
<-
bron
[
order
(
bron
$
date
),]
bron
$
city
=
trimws
(
gsub
(
'\\s+'
,
' '
,
gsub
(
"-|'"
,
' '
,
str_replace_all
(
bron
$
city
,
"\\s"
,
" "
))))
bron
$
city
<-
paste
(
toupper
(
substr
(
bron
$
city
,
1
,
1
)),
substr
(
bron
$
city
,
2
,
nchar
(
bron
$
city
)),
sep
=
""
)
zonder_split
<-
bron
[
bron
$
ranking
!=
"Split"
,]
bovennul
<-
zonder_split
[
zonder_split
$
points
!=
0
,]
...
...
@@ -99,7 +102,7 @@ doId <- function(input) {
Plot_CountsParAfstandSlag_dates
<-
ggplotly
(
Plot_CountsParAfstandSlag_dates
,
dynamicTicks
=
TRUE
,
tooltip
=
c
(
'x'
,
'y'
,
'text'
))
appendPlotly
(
Plot_CountsParAfstandSlag_dates
)
tabel_Prs
<-
bovennul
%>%
tabel_Prs
_metpooltype
<-
bovennul
%>%
group_by
(
distance
,
stroke
,
poolType
)
%>%
filter
(
points
==
max
(
points
,
na.rm
=
TRUE
))
%>%
filter
(
time
==
min
(
time
,
na.rm
=
TRUE
))
...
...
@@ -117,15 +120,15 @@ doId <- function(input) {
'<br>'
,
'<sup>'
,
'rose: Pbs (inclusive timed disqualifications, exlusive split-times)'
,
'</sup>'
)))
appendPlotly
(
tijdlijn_alles
)
tabel_Prs_
small
<-
bovennul
%>%
tabel_Prs_
zonderpooltype
<-
bovennul
%>%
group_by
(
distance
,
stroke
)
%>%
filter
(
points
==
max
(
points
,
na.rm
=
TRUE
))
%>%
filter
(
time
==
min
(
time
,
na.rm
=
TRUE
))
heatmap_prs
<-
ggplot
(
tabel_Prs_
small
,
aes
(
distance
,
stroke
,
text
=
date
))
+
heatmap_prs
<-
ggplot
(
tabel_Prs_
zonderpooltype
,
aes
(
distance
,
stroke
,
text
=
date
))
+
geom_tile
(
aes
(
fill
=
points
))
+
geom_text
(
aes
(
label
=
points
),
size
=
7
)
+
labs
(
title
=
"Heatmap punten per slag en afstand"
)
+
labs
(
title
=
"Heatmap punten per slag en afstand
. Geen laptijden.
"
)
+
theme_bw
()
heatmap_prs
<-
ggplotly
(
heatmap_prs
,
tooltip
=
c
(
'text'
))
%>%
layout
(
dragmode
=
FALSE
)
appendPlotly
(
heatmap_prs
)
...
...
@@ -145,7 +148,7 @@ doId <- function(input) {
plottabel_LastSwam
<-
plottabel_LastSwam
%>%
layout
(
title
=
'Last swam par distance and pooltype'
)
appendPlotly
(
plottabel_LastSwam
)
breedte_perslag
=
unique
(
tabel_Prs
[,
c
(
'distance'
,
'stroke'
)])
%>%
group_by
(
stroke
)
%>%
count
()
breedte_perslag
=
unique
(
tabel_Prs
_metpooltype
[,
c
(
'distance'
,
'stroke'
)])
%>%
group_by
(
stroke
)
%>%
count
()
breedte_perslag
=
breedte_perslag
$
n
breedte_perslag
=
breedte_perslag
/
(
breedte_perslag
%>%
sum
())
...
...
@@ -159,16 +162,15 @@ doId <- function(input) {
facet_wrap
(
.
~
stroke
,
scales
=
'free_x'
),
tooltip
=
c
(
'x'
,
'y'
,
'label'
,
'text'
))}
facetwrap_prs
=
tabel_Prs
[
order
(
tabel_Prs
$
poolType
),]
%>%
split
(
.
$
stroke
)
%>%
map
(
barplot_facets
)
facetwrap_prs
=
tabel_Prs
_metpooltype
[
order
(
tabel_Prs
_metpooltype
$
poolType
),]
%>%
split
(
.
$
stroke
)
%>%
map
(
barplot_facets
)
facetwrap_prs
=
facetwrap_prs
%>%
subplot
(
widths
=
breedte_perslag
,
margin
=
0.01
,
shareY
=
TRUE
)
%>%
layout
(
showlegend
=
FALSE
,
dragmode
=
FALSE
,
title
=
'Prs'
)
appendPlotly
(
facetwrap_prs
)
tabel_lasts
=
tabel_LastEntrys
[
order
(
tabel_LastEntrys
$
poolType
),]
tabel_lasts
=
tabel_lasts
[
tabel_lasts
$
points
!=
0
,]
tabel_lasts
=
tabel_LastEntrys
[
order
(
tabel_LastEntrys
$
poolType
),]
%>%
filter
(
points
!=
0
)
facetwrap_lasts
=
tabel_lasts
%>%
split
(
.
$
stroke
)
%>%
map
(
barplot_facets
)
facetwrap_lasts
=
facetwrap_lasts
%>%
subplot
(
widths
=
breedte_perslag
,
margin
=
0.01
,
shareY
=
TRUE
)
%>%
layout
(
showlegend
=
FALSE
,
dragmode
=
FALSE
,
title
=
'Last entrys'
)
layout
(
showlegend
=
FALSE
,
dragmode
=
FALSE
,
title
=
'Last entrys
. Points >0, so no laptimes, 25m-times, disqualifiactions etc.
'
)
appendPlotly
(
facetwrap_lasts
)
stippenplot_sizes
<-
ggplot
(
bovennul
,
aes
(
x
=
date
,
y
=
points
,
color
=
stroke
,
size
=
distance
,
group
=
AfstandSlag
))
+
...
...
@@ -195,7 +197,7 @@ doId <- function(input) {
naam_laatstgezien
=
goede_naam
}
appendPlotly
(
lijnenplot_ineen
)
for
(
pooltype_loop
in
c
(
'25m'
,
'50m'
)){
for
(
pooltype_loop
in
unique
(
bovennul
$
poolType
)){
title_plot
=
paste
(
"Points - "
,
pooltype_loop
,
'pool'
)
lijnenplot_pooltype
=
ggplot
(
bovennul
[
bovennul
$
poolType
==
pooltype_loop
,],
aes
(
x
=
date
,
y
=
points
,
text
=
AfstandSlag
,
...
...
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