Dygraphs

Full examples and documentation here: https://rstudio.github.io/dygraphs/index.html

Load library

Optional code to install from github and install

devtools::install_github("rstudio/dygraphs")
library(dygraphs)

Load Library using geneorama, this uses the CRAN version.

geneorama::loadinstall_libraries("dygraphs")

Very basic line example using defaults

lungDeaths <- cbind(mdeaths, fdeaths)
dygraph(lungDeaths)

Stacked bar example

dygraph(lungDeaths) %>%
    dySeries("mdeaths", label = "Male") %>%
    dySeries("fdeaths", label = "Female") %>%
    dyOptions(stackedGraph = TRUE) %>%
    dyRangeSelector(height = 20)

Example of making plot manually

p <- dygraph(lungDeaths)
p <- dySeries(p, "mdeaths", label = "Male")
p <- dySeries(p, "fdeaths", label = "Female")
p <- dyOptions(p, stackedGraph = TRUE)
p <- dyRangeSelector(p, height = 20)
p


geneorama/geneorama documentation built on Oct. 17, 2020, 12:35 a.m.