Created
October 28, 2014 11:49
-
-
Save jjallaire/e235e04cab8ebab94f25 to your computer and use it in GitHub Desktop.
htmlwidgets and runtime: shiny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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") | |
``` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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