File: dyRebase.Rd

package info (click to toggle)
r-cran-dygraphs 1.1.1.6%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,232 kB
  • sloc: javascript: 10,787; sh: 19; makefile: 15
file content (39 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rebase.R
\name{dyRebase}
\alias{dyRebase}
\title{Rebase data handler for straw broom charts with Dygraph}
\usage{
dyRebase(dygraph, value = 100, percent = FALSE)
}
\arguments{
\item{dygraph}{Dygraph to draw chart on}

\item{value}{Value to rebase to}

\item{percent}{If true, ingnore value argument and rebase to percentage difference}
}
\value{
Dygraph with specified straw broom chart
}
\description{
Draw a straw broom chart.
}
\examples{
\dontrun{
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)
}

}