Skip to content
Snippets Groups Projects
Commit 8a767ea9 authored by Berinda van Dijk's avatar Berinda van Dijk
Browse files

Bugfix: filter the last-entry-table if you swam multiple times the same...

Bugfix: filter the last-entry-table if you swam multiple times the same distance on the same day(for example prelim and final). So no 'weird' heatmaps anymore.
Small bugfix: no Nan's in the city-column any more if the competition has no meet-id
Small improvement: dates in heatmaps are one size bigger.
parent 386004a1
Branches
No related tags found
1 merge request!15Fixed bug for times > 1 hour, small bugfix and one improvement
......@@ -83,7 +83,7 @@ doId <- function(input) {
bron$seconden <- as.numeric(str_sub(bron$time, start =6))
bron$tijdsduur <- duration(second = bron$seconden, minute = bron$minuten, hour=bron$uren)
bron <- subset(bron, select = -c(minuten, seconden, uren))
bron<-separate(bron, col='city', into=c("MeetId", 'city'), sep=" - ")
bron<-separate(bron, col='city', into=c("MeetId", 'city'), sep=" - ", fill='left')#avoid empty place if theres no MeetId
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="")
......@@ -151,13 +151,15 @@ doId <- function(input) {
tabel_LastEntrys<-zonder_split%>%
filter(Lap==FALSE)%>%
group_by(distance, stroke, poolType) %>%
filter(date == max(date, na.rm=TRUE))
filter(date == max(date, na.rm=TRUE))%>%
filter(tijdsduur==min(tijdsduur))#if you
#anders problemen als je meerdere keren hetzelfde zwemt op een dag. Misschien alleen als je verschillende heattypes hebt?
for (pooltype_loop in unique(tabel_LastEntrys$poolType)){
title_plot=paste("Last date swam - ", pooltype_loop, 'pool')
heatmap_lastswam=ggplot(tabel_LastEntrys[tabel_LastEntrys$poolType==pooltype_loop,],
aes(distance, stroke, text=date)) +
geom_tile(aes(fill = date)) + geom_text(aes(label = format(date, format="%e %b\n%Y")), size=4) +
geom_tile(aes(fill = date)) + geom_text(aes(label = format(date, format="%e %b\n%Y")), size=5) +
labs(title = title_plot)+ theme_bw()
heatmap_lastswam=ggplotly(heatmap_lastswam, tooltip=FALSE)%>%
layout(dragmode=FALSE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment