-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathglobal.R
More file actions
35 lines (25 loc) · 1.17 KB
/
global.R
File metadata and controls
35 lines (25 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
options(dplyr.summarise.inform = FALSE)
library(shiny)
library(bslib)
library(shinyWidgets)
library(DT)
library(reactable)
library(dplyr)
library(tidyr)
library(scorekeepeR)
# max height of value boxes
mxht = "120px"
data_dir = "data"
if (!dir.exists(data_dir)) dir.create(data_dir)
teams_file = file.path(data_dir, "Teams.csv")
teams = if (file.exists(teams_file)) read.csv(teams_file) else init_teams_table()
players_file = file.path(data_dir, "Players.csv")
players = if (file.exists(players_file)) read.csv(players_file) else init_players_table()
rosters_file = file.path(data_dir, "Rosters.csv")
rosters = if (file.exists(rosters_file)) read.csv(rosters_file, colClasses = "character") else rosters = init_rosters_table()
games_file = file.path(data_dir, "Games.csv")
games = if (file.exists(games_file)) read.csv(games_file) else init_games_table()
game_stats_file = file.path(data_dir, "GameStats.csv")
game_stats = if (file.exists(game_stats_file)) read.csv(game_stats_file) else init_game_stats_table()
if (!dir.exists(file.path(data_dir, "gamelogs"))) dir.create(file.path(data_dir, "gamelogs"))
group_by_opts <- c("Team" = "TeamID", "Game" = "GameID", "Player" = "PlayerID")