First: Thanks for your help.
The idea is to create a shiny app to track some kind of "Sports". Maybe more like tracking the results of a drinking game... Its called Funkyball where you throw a ball at a target, run and drink. My goal is to collect and analyze data of how well people throw, drink and run.
The first tabPanel is to create some Player.
library(shiny)
ui <- fluidPage(
mainPanel(tabsetPanel(
tabPanel("All Player",
textInput("str_new_Player","New Player", ""),
actionButton("update", "add Player"),
tableOutput("tb_player")))))
server <- function(input, output) {
values <- reactiveValues()
values$df <- data.frame("Player" = numeric(0))
newEntry<- observe({
if(input$update > 0){
newLine <- isolate(input$str_new_Player)
isolate(values$df[nrow(values$df) + 1,] <- c(input$str_new_Player))
}})
output$tb_player <- renderTable({values$df})}
shinyApp(ui = ui, server = server)
So far so good. In the second tabPanel you would choose the first and second Player depending on your created Players. Thats where I struggle. ui:
tabPanel("New Game",
selectInput("Player_one", "Player 1", choices = "", selected = "")
server:
updateSelectInput(session, "Player_one",
label = paste("Player 1"),
choices = values$df,
selected = "")
I don't know how to insert the Choices from the updated table.
Next step is adding some actionbuttons that fill a table with data if you click on them. Like hit or miss and a stopclock for measuring the time that people need per game.