Skip to content

Instantly share code, notes, and snippets.

@jjallaire
Created October 28, 2014 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjallaire/e235e04cab8ebab94f25 to your computer and use it in GitHub Desktop.
Save jjallaire/e235e04cab8ebab94f25 to your computer and use it in GitHub Desktop.
htmlwidgets and runtime: shiny
---
title: "Dygraphs in R Markdown"
output: html_document
runtime: shiny
---
```{r}
library(dygraphs)
hw <- HoltWinters(ldeaths)
p <- predict(hw, n.ahead = 36, prediction.interval = TRUE, level = 0.95)
ts <- cbind(ldeaths, p)
dygraph(ts, "Deaths from Lung Disease (UK)") %>%
dySeries("ldeaths", label = "Deaths") %>%
dySeries(c("p.lwr", "p.fit", "p.upr"), label = "Predicted")
```
---
title: "R Markdown networkD3"
output: html_document
runtime: shiny
---
```{r}
library(networkD3)
src <- c("A", "A", "A", "A", "B", "B", "C", "C", "D")
target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I")
networkData <- data.frame(src, target)
simpleNetwork(networkData)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment