I have the shiny app below in which I create multi.js
input with country names and flags. Now vector country works but fos specific countries and names for example de instead of Germany but what if I have a vector like countries2
with different and more country names ?
library(shiny)
library(shinyWidgets)
countries <- c('de', 'br','gr')
countries2 <- c('Germany', 'Brazil','Greece','Italy')
img_urls <- paste0(
'https://cdn.rawgit.com/lipis/flag-icon-css/master/flags/4x3/',
countries, '.svg'
)
input_widget <- multiInput(
inputId = "Id010",
label = "Countries :",
choices = NULL,
choiceNames = lapply(
seq_along(countries2),
function(i) {
tagList(
tags$img(src = img_urls[i], width = 20, height = 15),
countries2[i]
)
}
),
choiceValues = countries2
)
ui <- fluidPage(
input_widget
)
server <- function(input, output, session) {
}
shinyApp(ui, server)