Plotly plot not rending in RMarkdown Shiny Document HTML Output

I am trying to render a plotly plot in a Shiny Document.

Here's the code for my RMarkdown Shiny Document:


title: "Shiny Doc Test"
output: html_notebook
runtime: shiny

pickerInput("Machine1", label = "Select a Machine", choices = str_sub(unique(sort(unique(df_dailyagg$MachineID))), -3, -1),options = list(actions-box = TRUE), multiple = TRUE, selected = "ConneCT00067")

data_bins <- reactive(df_dailyagg %>% filter(str_sub(df_dailyagg$MachineID, -3, -1) %in% input$Machine1))

renderPlotly({ggplotly(data_bins() %>% ggplot(aes(x=Bag.Start.Date,y=Bins,group=MachineID,color=MachineID)) + geom_point() + geom_line() + scale_color_manual(values=RColorBrewer::brewer.pal(8, "Accent")[1:8]) + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)))})


This is what the output looks like on http://127.0.0.1/

![TestOutput|690x382](upload://mCcQ1k72L8JRioaWSFt31p0VDlB.png)

But when I export the RMD to an HTML Output file, it looks like this:

![TestOutputHTML|690x398](upload://hoaTTaZ6bAnZdN0tawYbGBq0HtG.png)

The plot is missing, while the input is still there.

I ran this code to render the document

rmarkdown::render("Test.RMD", runtime = "shiny_prerendered")

How do I get the plot to be shown in the HTML Output?

Can you format correctly so that we could reproduce and help ?

FAQ: How to Format R Markdown Source

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.