Skip to content

Commit dc02bd3

Browse files
committed
A03Ca_charts Shiny app finalized for 2024-2025
1 parent 1f112f3 commit dc02bd3

File tree

1 file changed

+6
-4
lines changed
  • inst/shiny/A03Ca_charts

1 file changed

+6
-4
lines changed

inst/shiny/A03Ca_charts/app.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# ================================================
33
# Note: the shared folder is created like this using SSH onto the server
44
# cd /data1
5-
# sudo mkdir A04_challenge
6-
# sudo chown rstudio-connect: A04_challenge
5+
# sudo mkdir A03_challenge
6+
# sudo chown rstudio-connect:rstudio-connect A03_challenge
77

88
# We also need flipdown from:
99
#remotes::install_github("feddelegrand7/flipdownr")
@@ -20,9 +20,9 @@ deadline <- Sys.getenv("CHALLENGE_DEADLINE",
2020
unset = "2024-01-01 00:00:00")
2121

2222
# Read data from the SQLite database
23-
dir <- "/data1/A04_challenge"
23+
dir <- "/data1/A03_challenge"
2424
if (!file.exists(dir))
25-
dir <- "~/A04_challenge" # Alternate dir for local tests
25+
dir <- "~/A03_challenge" # Alternate dir for local tests
2626
database <- file.path(dir, "charts.sqlite")
2727
table <- "charts"
2828

@@ -183,6 +183,8 @@ server <- function(input, output) {
183183
ranking <- ranking[order(-ranking$score, as.numeric(ranking$date)), ]
184184
ranking$date <- as.POSIXct(ranking$date, origin = "1960-01-01")
185185
ranking$date <- format(ranking$date, "%Y-%m-%d %H:%M:%S")
186+
# Keep only best score for each student or team
187+
ranking <- ranking[!duplicated(ranking$project), ]
186188
}
187189
message("Date reworked")
188190
# Add a column with medals for the three first results

0 commit comments

Comments
 (0)