I'm using R shiny tools and I meet a problem. When I use the multiple select button, I want to add a comma at the end of every selections,here is what I do:
UI.R
conditionalPanel("input.Select_Table == 'Demographics'",
selectInput(inputId ="demo",label ="select variables you need", multiple = TRUE,
choices=c('Respondent_ID','year','month','City','City_Level','Province',
'Region','Actual_Age','Age_Level','Household_Income','Personal_Income_Level')))
Server.R
output$demo <- renderText(paste(substring(input$Select_Table,1,1),".",input$demo,","))
the output would be like this:
D . City , D . year , D . Province ,
however,I don't want the last comma at the end of last selection(the one behind"D . Province ,"), but so far I haven't find a way to delete it automatically. Could you please help me?
Thanks a lot,
Verse