In Rmarkdown to generate a flexdashboard, I want to import an excel sheet and use selectInput statement to select any of 2,3,4,5 columns (product1,product2,product3,product4) from excel sheet and plot a scatter chart for column1(Day) vs selected column from selectInput statement(product1 or product2 or product3 or product4). Can someone please help me with the R code?enter image description here
--- title: "General plots" author: "Aravind" date: "April 1st,2018" output: flexdashboard::flex_dashboard: orientation: columns
runtime: shiny
{r, echo=FALSE} library(readxl) library(flexdashboard) library(shiny) library(plotly) data_to_plot<-read_excel("random.xlsx")
Inputs {.sidebar}{r Global Filter Panel, echo=FALSE} selectInput("Product","Activity",choices=c('product1','product2','product3','product4'),selected=NULL,width = '400px')
Under this tab chart will be displayedChart {.tabsets .tabset-fade}
Chart ```{r echo=FALSE, message=FALSE}
renderPlotly(
p<-plot_ly( data_to_plot,x=~Product,y=~Day, color ="red", type="scatter")%>% layout(title="Scatter plot using R plotly", xaxis=list(title="Day"),yaxis=list(title="Product"), legend=list(x=1,y=0.5))%>% p )```