Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rstudio/dygraphs
R interface to dygraphs
https://github.com/rstudio/dygraphs
Last synced: 5 days ago
JSON representation
R interface to dygraphs
- Host: GitHub
- URL: https://github.com/rstudio/dygraphs
- Owner: rstudio
- License: other
- Created: 2014-08-15T14:03:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-15T04:26:22.000Z (10 months ago)
- Last Synced: 2024-12-30T04:03:16.911Z (12 days ago)
- Language: JavaScript
- Homepage: http://rstudio.github.io/dygraphs
- Size: 2.54 MB
- Stars: 365
- Watchers: 43
- Forks: 193
- Open Issues: 121
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - dygraphs - R interface to the dygraphs JavaScript charting library. (Visualization / Time Series)
- awesome-r-dataviz - dygraphs - R interface to dygraphs. (Interactive plots / Miscellaneous)
README
# dygraphs for R
[![CRAN status](https://www.r-pkg.org/badges/version/dygraphs)](https://cran.r-project.org/package=dygraphs)
[![R-CMD-check](https://github.com/rstudio/dygraphs/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/dygraphs/actions)
[![codecov](https://codecov.io/gh/rstudio/dygraphs/branch/master/graph/badge.svg?token=1z2BOSMfZe)](https://codecov.io/gh/rstudio/dygraphs)The dygraphs package is an R interface to the [dygraphs](https://dygraphs.com) JavaScript charting library. It provides rich facilites for charting time-series data in R, including:
- Automatically plots [xts](http://cran.rstudio.com/web/packages/xts/index.html) time series objects (or any object convertible to xts).
- Highly configurable axis and series display (including optional second Y-axis).
- Rich interactive features including [zoom/pan](https://rstudio.github.io/dygraphs/gallery-range-selector.html) and series/point [highlighting](https://rstudio.github.io/dygraphs/gallery-series-highlighting.html).
- Display [upper/lower bars](https://rstudio.github.io/dygraphs/gallery-upper-lower-bars.html) (e.g. prediction intervals) around series.
- Various graph overlays including [shaded regions](https://rstudio.github.io/dygraphs/gallery-shaded-regions.html), [event lines](https://rstudio.github.io/dygraphs/gallery-event-lines.html), and point [annotations](https://rstudio.github.io/dygraphs/gallery-annotations.html).
- Use at the R console just like conventional R plots (via RStudio Viewer).
- Seamless embedding within [R Markdown](https://rstudio.github.io/dygraphs/r-markdown.html) documents and [Shiny](https://rstudio.github.io/dygraphs/shiny.html) web applications.## Installation
The dygraphs package depends on the development version of the [htmlwidgets](https://github.com/ramnathv/htmlwidgets) package so you need to install both packages. You can do this using the **devtools** package as follows:
```S
devtools::install_github(c("ramnathv/htmlwidgets", "rstudio/dygraphs"))
```## Usage
If you have an xts-compatible time-series object creating an interactive plot of it is as simple as this:
```S
dygraph(nhtemp, main = "New Haven Temperatures")
```You can also further customize axes and series display as well as add interacitve features like a range selector:
```S
dygraph(nhtemp, main = "New Haven Temperatures") %>%
dyAxis("y", label = "Temp (F)", valueRange = c(40, 60)) %>%
dyOptions(fillGraph = TRUE, drawGrid = FALSE) %>%
dyRangeSelector()
```See the [online documentation](http://rstudio.github.io/dygraphs) for the dygraphs package for additional details and examples.