I'm working on a shiny app and I wonder if there is a method to recuperate the selected data by the user through selectinput as a vector or character? In fact, I typed the following code
color<-read.xlsx("colors.xlsx",startRow = 1,sheet = 1,colNames = TRUE)
myList<-color$name
ui <- fluidPage(
sidebarLayout(
sidebarPanel(helpText(
fileInput("myData", "Upload your data ")
sidebarPanel(
),
),
mainPanel(
# selectInput(inputId = "couleurs",label = "Select colors:",choices = myList,selected = "Dark turquoise", multiple = TRUE))
# colourInput("col", "Select colour", "purple")
))
server <- function(input, output) {}
shinyApp(ui = ui, server = server)
the colors Database consists of 2 columns: the color name like Dark turquoise and code of color like "#00CED1" as follows
Name Code
Absolute Zero #0048BA
Acajou #4C2F27
Acid green #B0BF1A
Aero #7CB9E8
Aero blue #C9FFE5
African violet #B284BE
Air Force blue (RAF) #5D8AA8
Air Force blue (USAF) #00308F
Air superiority blue #72A0C1
Alabama crimson #AF002A
Alabaster #F2F0E6
Alice blue #F0F8FF
Alizarin crimson #E32636
Alloy orange #C46210
Almond #EFDECD
here I suggested whether to use the selectinput method and take the passed value which is the selected colors of use the color picker method to generate the character that regroups the selection as : '"#5D8AA8","#72A0C1"' for example the problem is I couldn't make the selection in the method 1 using the command "filter" and for the second method if I try to save the color code on color picker and paste it to the new code of color the first text changes !
Even with the solution that some of you has proposed to work with color codes as names to colors I still get errors