Description Usage Arguments Value event-logging event-log See Also Examples
View source: R/extract_subsignals.R
This function depends on an existing 'signal'-column (see
tbl_mbte
). The indexing function f
is used to split
a signal into subsignals. This function is useful, if only certain parts
of a signal are relevant (e.g. remove parts, where the measured
signal-values are below a specific threshold via a custom
indexing-function
).
1 |
x |
A |
f |
An |
... |
Additional arguments passed to 'f' |
The original table gets returned. The 'signal'-column
is modified (since subsignals are extracted according to the indexing
function f
). Additionally, the column 'signal_nr' is added, which
indicates the number of the subsignal within the original signal.
e.g. Assuming that x
only contains one row (hence only one element is
present in the 'signal'-list column). The indexing function f
determines, that the signal contains 3 subsignals. Therefore, the original
signal-tibble is split into 3 tibbles. The returned table will have 3 rows.
The column 'signal_nr' will be equal to c(1, 2, 3)
.
This function logs unusual events. A warning gets raised at the end of an
execution, if events have been logged. The event-log can be retrieved
by passing the returned object to mbte_event_log
. In this
case, a tibble containing the logged events will be returned to the user.
The tibble containing event-information consists of 3 columns:
The unprocessed error, which occurred during execution.
The row-number of the input-tibble (x
), at which the
error occurred.
The signal-subtable processed at the time the error occurred.
NOTE: currently warnings are not logged.
raw_signals
(dataset used in examples)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(dplyr, warn.conflicts = FALSE)
data(raw_signals)
# create nested tbl_mbte (needed for subsignal-extraction)
tbl <- raw_signals %>%
group_by(mv) %>%
new_tbl_mbte(time = "t", value = "value") %>%
mbte_nest_signals()
# a signal-subtable with leading zeros (should be removed)
tbl$signal[[9]]
# perform subsignal extraction
#
# by default, mbte_default_indexer() gets used for signal-extraction
# in this case only nonzero values are interesting
extracted <- mbte_extract_subsignals(tbl)
extracted
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.