|
|
@@ -28,33 +28,6 @@ villespe %>% |
|
|
|
arrange(Discipline) %>% |
|
|
|
pull(Discipline) -> spes |
|
|
|
|
|
|
|
# Last update ---- |
|
|
|
Sys.setlocale("LC_TIME", "fr_FR.UTF-8") |
|
|
|
db %>% |
|
|
|
tbl("trajectoires") %>% |
|
|
|
select(timestamp) %>% |
|
|
|
distinct %>% |
|
|
|
collect(n = Inf) %>% |
|
|
|
pull(timestamp) %>% |
|
|
|
max %>% |
|
|
|
as.POSIXct %>% |
|
|
|
format(format = "%A %d %B %Y %H:%M") %>% |
|
|
|
str_to_title -> |
|
|
|
last_update |
|
|
|
|
|
|
|
# Epoch ---- |
|
|
|
db %>% |
|
|
|
tbl("trajectoires") %>% |
|
|
|
select(timestamp) %>% |
|
|
|
distinct %>% |
|
|
|
collect(n = Inf) %>% |
|
|
|
pull(timestamp) %>% |
|
|
|
min %>% |
|
|
|
as.POSIXct %>% |
|
|
|
format(format = "%A %d %B %Y %H:%M") %>% |
|
|
|
str_to_title -> |
|
|
|
epoch |
|
|
|
|
|
|
|
# Max rank ---- |
|
|
|
db %>% |
|
|
|
tbl("trajectoires") %>% |
|
|
@@ -70,8 +43,7 @@ db %>% dbDisconnect |
|
|
|
# UI ---- |
|
|
|
ui <- shinyUI(fluidPage( |
|
|
|
titlePanel("Celine Stalker"), |
|
|
|
p(str_c("Données à partir du ", epoch)), |
|
|
|
p(str_c("Dernières données du ", last_update)), |
|
|
|
uiOutput("dates"), |
|
|
|
sidebarLayout( |
|
|
|
sidebarPanel(radioButtons("Select", "Chercher par", choices = c("étudiant", "ville + spé"), selected = "étudiant"), |
|
|
|
conditionalPanel("input.Select == 'ville + spé'", |
|
|
@@ -91,6 +63,41 @@ ui <- shinyUI(fluidPage( |
|
|
|
# Server ---- |
|
|
|
server <- shinyServer(function(input, output) |
|
|
|
{ |
|
|
|
output$dates <- renderUI({ |
|
|
|
|
|
|
|
dbConnect(SQLite(), "ecn.db", on.exit(dbDisconnect(db), add = T)) -> db |
|
|
|
|
|
|
|
# Last update ---- |
|
|
|
Sys.setlocale("LC_TIME", "fr_FR.UTF-8") |
|
|
|
db %>% |
|
|
|
tbl("trajectoires") %>% |
|
|
|
select(timestamp) %>% |
|
|
|
distinct %>% |
|
|
|
collect(n = Inf) %>% |
|
|
|
pull(timestamp) %>% |
|
|
|
max %>% |
|
|
|
as.POSIXct %>% |
|
|
|
format(format = "%A %d %B %Y %H:%M") %>% |
|
|
|
str_to_title -> |
|
|
|
last_update |
|
|
|
|
|
|
|
# Epoch ---- |
|
|
|
db %>% |
|
|
|
tbl("trajectoires") %>% |
|
|
|
select(timestamp) %>% |
|
|
|
distinct %>% |
|
|
|
collect(n = Inf) %>% |
|
|
|
pull(timestamp) %>% |
|
|
|
min %>% |
|
|
|
as.POSIXct %>% |
|
|
|
format(format = "%A %d %B %Y %H:%M") %>% |
|
|
|
str_to_title -> |
|
|
|
epoch |
|
|
|
|
|
|
|
list(p(str_c("Données à partir du ", epoch)), |
|
|
|
p(str_c("Dernières données du ", last_update))) |
|
|
|
}) |
|
|
|
|
|
|
|
outTable <- reactive({ |
|
|
|
req(input$Select, input$Ville, input$Spe, input$Etudiant) |
|
|
|
|
|
|
|