From the below application, I getting the output as shown below
library(shiny)
library(DT)
nba <- data.frame(
player = c("c('James','James1')", "Durant", "Curry", "Harden", "Paul", "Wade"),
team = c("CLEOH", "GSWOAK", "GSWOAK", "HOUTX", "HOUTX", "CLEOH"),
day1points = c("25","23","30","41","26","20"),
day2points = c("24","25","33","45","26","23"),
rating=c("1","2","3","4","5","1")
)
ui <- navbarPage(
title="SADDAS",
sidebarLayout(
sidebarPanel(uiOutput("var1_select")),
mainPanel(tableOutput("reportOutput"))
))
server <- function(input, output) {
output$var1_select <- renderUI({
selectInput(
"ind_var_select",
"Select Names",
choices = as.character(nba[,1] ),
multiple = TRUE,
selected = as.character(nba[1,1]),
)
})
output$reportOutput = renderTable({
# Filter it
subset(nba[,1:3], player %in% input$ind_var_select)
}, options = list(scrollX = TRUE))
}
shinyApp(ui, server)
But is there a way to split it like shown below
Expected output. Basically I am trying to split the characters in selectinput
Note : Please forget the table at the right:)