-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
74 lines (48 loc) · 2.42 KB
/
app.R
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
library(shiny)
library(DT)
# load in all our R objects for the dataframes
shane_df <- readRDS(file = "Data/beliebers.rds")
redemption_df <- readRDS(file = "Data/kshank.rds")
choo_df <- readRDS(file = "Data/choo.rds")
beavens_df <- readRDS(file = "Data/beavens.rds")
tyrone_df <- readRDS(file = "Data/tyrone.rds")
Mckenna_df <- readRDS(file = "Data/mckenna.rds")
votos_df <- readRDS(file = "Data/bartolos.rds")
a_rod_df <- readRDS(file = "Data/ARod.rds")
sniffers_df <- readRDS(file = "Data/Sniffersrow.rds")
christy_df <- readRDS(file = "Data/Team_christy.rds")
long_ball_df <- readRDS(file = "Data/Long_Ball.rds")
wright_df <- readRDS(file = "Data/The_Wright.rds")
# Define UI for application that supplies interactive data tables
ui <- fluidPage(
titlePanel("An app for displaying Fantasy draft results "),
sidebarLayout(sidebarPanel(helpText("Create a datatable for fantasy draft results based on team. Note that the dashboard only permits one table at a time"),
radioButtons("team", "Choose a team:", choices = c("Kershawshank Redemption", "Choo Talkin to Me?", "Team Beavens", "I'am Tyrone",
"Team Mckenna", "Bartolos Votos", "Shane Beliebers", "A Rod", "Sniffer's Row", "Team Christy", "Long Ball", "The Wright Players"), selected = "Shane Beliebers")
),
mainPanel(DT::dataTableOutput('table'))
)
)
# Define server logic required to draw interactive data tables
server <- function(input, output) {
output$table <- DT::renderDataTable(
team_displayed <- teamInput()
)
teamInput <- reactive({
switch (input$team,
"Kershawshank Redemption" = redemption_df,
"Choo Talkin to Me?" = choo_df,
"Team Beavens" = beavens_df,
"I'am Tyrone" = tyrone_df,
"Team Mckenna" = Mckenna_df,
"Bartolos Votos" = votos_df,
"Shane Beliebers" = shane_df,
"A Rod" = a_rod_df,
"Sniffer's Row" = sniffers_df,
"Team Christy" = christy_df,
"Long Ball" = long_ball_df,
"The Wright Players" = wright_df)
})
}
# Run the application
shinyApp(ui = ui, server = server)