I have the following RMarkdown .Rmd
document. When you run the following, the sliderInput
is "reactive" and adjust the smoothing appropriately; however, the plot keeps generating in a new separate browser window rather than within the document itself.
Any ideas why this is happening or how to fix this behavior?
---
title: "Untitled"
output: html_document
runtime: shiny
---
```{r echo=FALSE}
library(dygraphs)
sliderInput("span", label = "Select Span",
min=0.05, max=1, value=0.5, step=0.05)
renderPlot({
plx <- predict(loess(ldeaths ~ time(ldeaths), span=input$span), se =T)
fit <- plx$fit
lower <- plx$fit - qt(0.975, plx$df) * plx$se
upper <- plx$fit + qt(0.975, plx$df) * plx$se
all <- cbind(ldeaths, fit, lower, upper)
dygraph(all, main="Title") %>%
dySeries(c("lower", "fit", "upper"), label="Deaths")
})
```