I am trying to create a dashboard for a project that I am working on. In this project, I am trying to integrate a few plots from tableau.public.com using renderUI
. I want the dashboard to use selectInput
to select which tableau plot will be displayed. I have changed the URLs below so they will not work if searched.
My current code is:
plot1<-"https://public.tableau.com/views/Sheet2?:showVizHome=no&:embed=true"
plot2<-"https://public.tableau.com/views/Sheet3?:showVizHome=no&:embed=true"
fluidPage(
##### Give a Title #####
titlePanel("Tableau Visualizations"),
## Month Dropdown ##
selectInput("URL", label = "Visualization:",
choices = c(plot1,plot2), selected = plot1))
And code for displaying the Tableau pages:
renderUI({
tags$iframe(style="height:600px; width:100%; scorlling=yes", src=input$URL)
})
The code does what I want it to do, except for the the selectInput option. I would like to have the choices in the drop-down menu refer to the actual plot name (plot1
, plot2
). However, since they variable names, the actual drop-down menu has the url listed. I cannot use the following because then it doesn't recognize the choices as variables anymore:
## Month Dropdown ##
selectInput("URL", label = "Visualization:",
choices = c("plot1,"plot2"), selected = plot1))
Is there anyway I can have the names of the variables displayed, but not the url that they represent?
Thank you