LTTB_aggregator | R Documentation |
The LTTB method aggregates the huge samples using the areas of the triangles formed by the samples. Numerical distances are employed in this class, which requires the ratio between x and y values. When the x is datetime, nanosecond is a unit. When the x is factor or character, it will be encoded into numeric codes.
An R6::R6Class
object
shinyHugePlot::aggregator
-> LTTB_aggregator
new()
Constructor of the aggregator.
LTTB_aggregator$new( ..., nt_y_ratio = 1e+09, x_y_ratio = 1, interleave_gaps, coef_gap, NA_position )
x_y_ratio, nt_y_ratio
Numeric.
These parameters set the unit length of the numeric x
and nanotime
x.
For example, setting x_y_ratio
to 2 is equivalent to
assuming 2 is the unit length of x
(and 1 is always the unit length of y
).
The unit length is employed to calculate the area of the triangles.
interleave_gaps, coef_gap, NA_position, ...
Arguments pass to the constructor of aggregator
object.
Note that accepted_datatype
has default value.
Downsample with the Largest Triangle Three Buckets (LTTB) aggregation method
clone()
The objects of this class are cloneable with this method.
LTTB_aggregator$clone(deep = FALSE)
deep
Whether to make a deep clone.
data(noise_fluct)
agg <- LTTB_aggregator$new(interleave_gaps = TRUE)
d_agg <- agg$aggregate(
x = noise_fluct$time, y = noise_fluct$f500, n_out = 1000
)
plotly::plot_ly(x = d_agg$x, y = d_agg$y, type = "scatter", mode = "lines")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.