Learn R Programming

shinyHugePlot (version 0.3.0)

candlestick_aggregator: Aggregation which returns the candle sticks

Description

This aggregator divides the data into no-overlapping intervals and calculate the first, maximum, minimum, and last values of the data, which represents candle sticks.

Arguments

Format

An R6::R6Class object

Super class

shinyHugePlot::aggregator -> candlestick_aggregator

Methods

Inherited methods


Method new()

Constructor of the aggregator.

Usage

candlestick_aggregator$new(..., interleave_gaps, coef_gap, NA_position)

Arguments

interleave_gaps, coef_gap, NA_position, ...

Arguments pass to the constructor of aggregator object.

yupr, y, ylwr

Functions. Statistical values are calculated using this function. By default, max, mean, min, respectively. Note that the NA values are omitted automatically.


Method clone()

The objects of this class are cloneable with this method.

Usage

candlestick_aggregator$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
data(noise_fluct)
agg <- candlestick_aggregator$new(interleave_gaps = TRUE)
d_agg <- agg$aggregate(nanotime::as.nanotime(noise_fluct$time), noise_fluct$f500, 100)
fig <- plotly::plot_ly(
  x = d_agg$x, open = d_agg$open, high = d_agg$high, low = d_agg$low, close = d_agg$close,
  type = "candlestick"
  )

Run the code above in your browser using DataLab