Summary statistics for team ready
This commit is contained in:
parent
6c4b99c4c7
commit
93d8ab5e5a
@ -28,10 +28,10 @@ Created with R version 3.6.0 and Shiny 1.3.2
|
|||||||
* Balance for one team ✔
|
* Balance for one team ✔
|
||||||
* Basic layout ✔
|
* Basic layout ✔
|
||||||
* Barplot for percentage balance ✔
|
* Barplot for percentage balance ✔
|
||||||
|
* Basic summary statistics per team/teams ✔
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* Basic summary statistics per team/teams ⛔
|
|
||||||
* Exception handling ⛔
|
* Exception handling ⛔
|
||||||
* Country filtering ⚠
|
* Country filtering ⚠
|
||||||
* Fix for columns naming in data table ⚠
|
* Fix for columns naming in data table ⚠
|
||||||
|
@ -86,7 +86,12 @@ balancePercentage <- function(input, output) {
|
|||||||
# Summary statistics
|
# Summary statistics
|
||||||
summaryStatistics <- function(input, output) {
|
summaryStatistics <- function(input, output) {
|
||||||
output$summary_statistics <- renderTable(
|
output$summary_statistics <- renderTable(
|
||||||
goalsOverallSummary(getFilteredResultsForTeam(input), input$team),
|
formattable(result <- goalsOverallSummary(getFilteredResultsForTeam(input), input$team),
|
||||||
|
list(
|
||||||
|
Home = color_tile("white", "orange")
|
||||||
|
)
|
||||||
|
),
|
||||||
|
width = '100%',
|
||||||
rownames = TRUE
|
rownames = TRUE
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -87,9 +87,9 @@ goalsOverallSummary <- function(matches, team) {
|
|||||||
lostAvg <- avgGoalsLost(matches, team)
|
lostAvg <- avgGoalsLost(matches, team)
|
||||||
|
|
||||||
goalsOverall <- data.frame(
|
goalsOverall <- data.frame(
|
||||||
"Home" = c(scored$home_goals, lost$home_goals, scoredAvg$home_goals_avg, lostAvg$home_goals_avg),
|
Home = c(scored$home_goals, lost$home_goals, scoredAvg$home_goals_avg, lostAvg$home_goals_avg),
|
||||||
"Away" = c(scored$away_goals, lost$away_goals, scoredAvg$away_goals_avg, lostAvg$away_goals_avg),
|
Away = c(scored$away_goals, lost$away_goals, scoredAvg$away_goals_avg, lostAvg$away_goals_avg),
|
||||||
"Overall" = c(scored$overall, lost$overall, scoredAvg$overall_avg, lostAvg$overall_avg),
|
Overall = c(scored$overall, lost$overall, scoredAvg$overall_avg, lostAvg$overall_avg),
|
||||||
stringsAsFactors = FALSE
|
stringsAsFactors = FALSE
|
||||||
)
|
)
|
||||||
row.names(goalsOverall) <- c("Scored","Lost", "Scored Avg", "Lost Avg")
|
row.names(goalsOverall) <- c("Scored","Lost", "Scored Avg", "Lost Avg")
|
||||||
|
15
UI/UI.R
15
UI/UI.R
@ -21,10 +21,10 @@ ui <- navbarPage(
|
|||||||
fluidRow(
|
fluidRow(
|
||||||
column(
|
column(
|
||||||
6,
|
6,
|
||||||
|
h2("Matches balance chart"),
|
||||||
tabsetPanel(
|
tabsetPanel(
|
||||||
tabPanel(
|
tabPanel(
|
||||||
"Charts",
|
"Bar plot",
|
||||||
h2("Matches balance charts"),
|
|
||||||
wellPanel(
|
wellPanel(
|
||||||
plotOutput("balance_for_team")
|
plotOutput("balance_for_team")
|
||||||
)
|
)
|
||||||
@ -33,8 +33,14 @@ ui <- navbarPage(
|
|||||||
),
|
),
|
||||||
column(
|
column(
|
||||||
6,
|
6,
|
||||||
wellPanel(
|
h2("Overall statistics"),
|
||||||
tableOutput("summary_statistics")
|
tabsetPanel(
|
||||||
|
tabPanel(
|
||||||
|
"Summary",
|
||||||
|
wellPanel(
|
||||||
|
tableOutput("summary_statistics")
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -58,6 +64,7 @@ ui <- navbarPage(
|
|||||||
fluidRow(
|
fluidRow(
|
||||||
column(
|
column(
|
||||||
6,
|
6,
|
||||||
|
h2("Matches balance charts"),
|
||||||
balanceComponent()
|
balanceComponent()
|
||||||
),
|
),
|
||||||
column(
|
column(
|
||||||
|
Loading…
Reference in New Issue
Block a user