Learn R Programming

shinyHugePlot (version 0.3.0)

aggregator: R6 base class for the aggregation

Description

A base class for the aggregation, which defines the structure of the class and is not available on a stand-alone basis.

Arguments

Format

An R6::R6Class object

Active bindings

parameters

Parameters for the aggregation, returned as a named list. Generate a matrix using x and n_out Apply function for nanotime

Methods


Method new()

Constructor of aggregator

Usage

aggregator$new(
  ...,
  interleave_gaps = FALSE,
  NA_position = "begin",
  coef_gap = 3
)

Arguments

...

Not used.

interleave_gaps, NA_position, coef_gap

Arguments passed to self$set_parameters, optional.


Method aggregate()

Aggregates the given input and returns samples.

Usage

aggregator$aggregate(x, y, n_out, db = NULL)

Arguments

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.


Method set_parameters()

Setting of the parameters for the aggregation

Usage

aggregator$set_parameters(..., interleave_gaps, NA_position, coef_gap)

Arguments

...

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 NAs 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.


Method clone()

The objects of this class are cloneable with this method.

Usage

aggregator$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.