aggregator | R Documentation |
A base class for the aggregation, which defines the structure of the class and is not available on a stand-alone basis.
An R6::R6Class
object
parameters
Parameters for the aggregation, returned as a named list. Generate a matrix using x and n_out Apply function for nanotime
new()
Constructor of aggregator
aggregator$new( ..., interleave_gaps = FALSE, NA_position = "begin", coef_gap = 3 )
...
Not used.
interleave_gaps, NA_position, coef_gap
Arguments passed to self$set_parameters
, optional.
aggregate()
Aggregates the given input and returns samples.
aggregator$aggregate(x, y, n_out, db = NULL)
x, y
Indexes and values that has to be aggregated.
n_out
Integer or numeric.
db
Character. The duck-db that contains the x-y data. The number of samples that the aggregated data contains.
set_parameters()
Setting of the parameters for the aggregation
aggregator$set_parameters(..., interleave_gaps, NA_position, coef_gap)
...
Not used.
interleave_gaps
Boolean, optional.
Whether NA
values should be added
when there are gaps / irregularly sampled data.
Irregular gaps between samples are determined whether the gap is larger than
the median of the sample gaps times the coefficient for detecting irregular gaps.
By default, FALSE
.
NA_position
Character, optional.
Indicates where NA
s are placed when gaps are detected.
If "end"
, the first point after a gap will be replaced.
If "begin"
, the last point before a gap will be replaced.
If "both"
, both the encompassing gap data points are replaced.
This parameter is only effective when interleave_gaps == TRUE
.
By default, "begin"
.
coef_gap
Numeric, optional. The coefficient to detect irregular gaps. By default, 3.0.
accepted_datatype
Character, optional.
This parameter indicates the supported data classes.
If all data classes are accepted, set it to NULL
.
clone()
The objects of this class are cloneable with this method.
aggregator$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.