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 ✔
|
||||
* Basic layout ✔
|
||||
* Barplot for percentage balance ✔
|
||||
* Basic summary statistics per team/teams ✔
|
||||
|
||||
## TODO
|
||||
|
||||
* Basic summary statistics per team/teams ⛔
|
||||
* Exception handling ⛔
|
||||
* Country filtering ⚠
|
||||
* Fix for columns naming in data table ⚠
|
||||
|
@ -86,7 +86,12 @@ balancePercentage <- function(input, output) {
|
||||
# Summary statistics
|
||||
summaryStatistics <- function(input, output) {
|
||||
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
|
||||
)
|
||||
}
|
@ -87,9 +87,9 @@ goalsOverallSummary <- function(matches, team) {
|
||||
lostAvg <- avgGoalsLost(matches, team)
|
||||
|
||||
goalsOverall <- data.frame(
|
||||
"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),
|
||||
"Overall" = c(scored$overall, lost$overall, scoredAvg$overall_avg, lostAvg$overall_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),
|
||||
Overall = c(scored$overall, lost$overall, scoredAvg$overall_avg, lostAvg$overall_avg),
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
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(
|
||||
column(
|
||||
6,
|
||||
h2("Matches balance chart"),
|
||||
tabsetPanel(
|
||||
tabPanel(
|
||||
"Charts",
|
||||
h2("Matches balance charts"),
|
||||
"Bar plot",
|
||||
wellPanel(
|
||||
plotOutput("balance_for_team")
|
||||
)
|
||||
@ -33,8 +33,14 @@ ui <- navbarPage(
|
||||
),
|
||||
column(
|
||||
6,
|
||||
wellPanel(
|
||||
tableOutput("summary_statistics")
|
||||
h2("Overall statistics"),
|
||||
tabsetPanel(
|
||||
tabPanel(
|
||||
"Summary",
|
||||
wellPanel(
|
||||
tableOutput("summary_statistics")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -58,6 +64,7 @@ ui <- navbarPage(
|
||||
fluidRow(
|
||||
column(
|
||||
6,
|
||||
h2("Matches balance charts"),
|
||||
balanceComponent()
|
||||
),
|
||||
column(
|
||||
|
Loading…
Reference in New Issue
Block a user