dyRebase: Rebase data handler for straw broom charts with Dygraph

Description Usage Arguments Value Examples

View source: R/rebase.R

Description

Draw a straw broom chart.

Usage

1
dyRebase(dygraph, value = 100, percent = FALSE)

Arguments

dygraph

Dygraph to draw chart on

value

Value to rebase to

percent

If true, ingnore value argument and rebase to percentage difference

Value

Dygraph with specified straw broom chart

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(quantmod)
tickers <- c("AAPL", "MSFT")
getSymbols(tickers)
closePrices <- do.call(merge, lapply(tickers, function(x) Cl(get(x))))
dateWindow <- c("2008-01-01", "2009-01-01")
dygraph(closePrices, main = "Value", group = "stock") %>%
  dyRebase(value = 100) %>%
  dyRangeSelector(dateWindow = dateWindow)
dygraph(closePrices, main = "Percent", group = "stock") %>%
  dyRebase(percent = TRUE) %>%
  dyRangeSelector(dateWindow = dateWindow)
dygraph(closePrices, main = "None", group = "stock") %>%
  dyRangeSelector(dateWindow = dateWindow)

## End(Not run)

dygraphs documentation built on May 2, 2019, 3:34 p.m.

Related to dyRebase in dygraphs...