This function is used to readd dropped-attributes, if a tbl_mbte-object gets processed by functions, which may drop additional attributes.

mbte_reconstruct(new, old)

# S3 method for tbl_mbte
mbte_reconstruct(new, old)

Arguments

new

Object, which the attributes should be added to (must be convertible to a tibble).

old

tbl_mbte, from which specific attributes are copied (`time`, `value`, `signal`, `fits`). Additionally, the class `tbl_mbte` gets added. The S3-generic dispatches on this argument.

Details

The implementation of sloop::reconstruct() gets used; This is a temporary workaround and will be removed, once the sloop-package is on CRAN.

See also

raw_signals (dataset used in examples)

Other tbl_mbte functions: is_tbl_mbte, new_tbl_mbte, tbl_mbte

Examples

data(raw_signals) # create template object for attribute reconstruction template <- new_tbl_mbte(raw_signals, time = "t", value = "value") # create target object, which lacks of the "time"-attribute target <- new_tbl_mbte(raw_signals, time = "t", value = "value") attr(target, "time") <- NULL
is_tbl_mbte(target) # FALSE
#> [1] FALSE
# reconstruct valid tbl_mbte from template target <- mbte_reconstruct(target, template)
is_tbl_mbte(target) # TRUE
#> [1] TRUE