Hi People,
I was trying to make an user interactive ggplot (on X axis Elements). Due to data size I used updateSelectizeInput inside renderPlot that might be anther issue.So the idea is to generate ggplot from the user input data and on this graph need to add x axis inter active section. Kindly share your ideas on the following code
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
conditionalPanel(
'input.dataset === "Choose-data"',
selectInput("list", "Select Your set",
list(
"NDD " = "ndd",
"All " = "all",))
selectInput(
inputId = 'mylist1', label = 'Choose',
choices = NULL,
selected = NULL,multiple=TRUE)),)))
mainPanel(
tabsetPanel(
id = 'dataset',
tabPanel("Choose",plotOutput("plot0", width = 1300, height = 600)))
server <- function(input, output,session)
dataa<-reactive({
if (input$list == 'all')
{ read.delim('all.txt',sep = "\t",header = T)
}
else{
if (input$Gene_list == 'ndd')
{
read.delim('data/sysID.txt',sep = ",",header = T)
}
}})
output$plot0 <- renderPlot({
dataa <- dataa()
list<-dataa$Description
updateSelectizeInput(session = session, inputId = 'mylist1', choices =list, server = TRUE)
graph_data<-c(input$mylist1)
merged<-merge(graph_data,dataa,by="Description")
traff2 <- melt(merged,id=c("Name","Description"),variable.name = "Sample")
plotzero<-ggplot(traff2, aes(x = Description, y = value,group= Sample,color=Sample))+geom_line()+geom_point()
print(plotzero)
})
shinyApp(ui, server)