-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_tables.r
More file actions
23 lines (18 loc) · 784 Bytes
/
Copy pathapp_tables.r
File metadata and controls
23 lines (18 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
partTIME <- reactive({ timeSum(STATS()[filtROW(), "Time.in.Video"]) })
filtCOL <- reactive( names(STATS()) %in% c("Part", input$tabCOLS) )
filtROW <- reactive( STATS()$Part %in% c(input$tabROWS) )
output$timeTable = renderTable({
cbind(
c(paste0("Total time in ", DATA$game), "Time in selected parts"),
c(timeSum(DATA$HRtime$Time), partTIME() )
)
}, striped = FALSE, colnames = FALSE)
output$summaryTable = renderTable({
out <- STATS()[filtROW(), filtCOL()]
levels(out$Part) = sapply(levels(out$Part), prettyNUM)
return(out)
}, digits = 2, striped = TRUE)
output$downloadTable = downloadHandler(
filename = function() {paste0(DATA$game, " - Table.csv")},
content = function(file) {write_csv(roundFRAME(STATS()[filtROW(), c("Part", "Time", input$tabCOLS)]), file)}
)