-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.R
More file actions
38 lines (32 loc) · 1.09 KB
/
Copy pathglobal.R
File metadata and controls
38 lines (32 loc) · 1.09 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
35
36
37
38
library(shiny)
library(bslib)
library(bsicons)
library(tidyverse)
library(plotly)
library(reactable)
library(scales)
library(zoo)
# Source all calculations and plot functions
source("R/functions.R")
# Load and Process Data
# The data was taken from the bowling company after our game
#The sheet is based the bowling company's algorithm for calculating scores and bonuses and i figured it will give me a hard time
# so i tried simplifying the scores by just taking the finding the bonus and adding i as a score from a strike.
bowling_raw <- tryCatch({
read_csv("bowling_data.csv")
}, error = function(e) {
NULL
})
player_names <- sort(unique(bowling_data$player))
if(!is.null(bowling_raw)){
bowling_data <- transform_bowling_data(raw_data = bowling_raw)
player_summary <- calculate_summary_stats(bowling_data)
# Colors to indentify each player
player_colors <- setNames(
c("#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A",
"#98D8C8", "#F7DC6F", "#BB8FCE", "#85C1E2")[1:length(player_names)],
player_names
)
} else {
stop("bowling_data.csv not found in the application directory.")
}