range_stat_aggregator | R Documentation |
This aggregator divides the data into no-overlapping intervals and calculate specific statistics that represents the range and nominal values of the data, such as the max, min and mean.
An R6::R6Class
object
shinyHugePlot::aggregator
-> shinyHugePlot::rng_aggregator
-> range_stat_aggregator
new()
Constructor of the aggregator.
range_stat_aggregator$new( ..., ylwr = min, y = mean, yupr = max, interleave_gaps, coef_gap, NA_position )
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.
interleave_gaps, coef_gap, NA_position, ...
Arguments pass to the constructor of aggregator
object.
clone()
The objects of this class are cloneable with this method.
range_stat_aggregator$clone(deep = FALSE)
deep
Whether to make a deep clone.
data(noise_fluct)
agg <- range_stat_aggregator$new(
ylwr = min, y = mean, yupr = max, interleave_gaps = TRUE
)
d_agg <- agg$aggregate(nanotime::as.nanotime(noise_fluct$time), noise_fluct$f500, 100)
plotly::plot_ly(x = d_agg$x, y = d_agg$y, type = "scatter", mode = "lines") %>%
plotly::add_trace(x = d_agg$x, y = d_agg$ylwr, type = "scatter", mode = "lines")%>%
plotly::add_trace(x = d_agg$x, y = d_agg$yupr, type = "scatter", mode = "lines")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.