mbte_default_indexer: The default 'indexing-function' for the mbte-package

Description Usage Arguments Examples

View source: R/extract_subsignals.R

Description

A subsignal is defined as a sequence of nonzero values in x. Therefore, elements near 0 are discarded and only the remaining nonzero elements of x are kept.

Usage

1

Arguments

x

A numeric vector (signal-values - see tbl_mbte).

...

Additional arguments (currently ignored)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# create a dummy vector, simulating measurement data
# NOTE: the values of `x` are the same as their index
x <- c(1:4, 0, 6:8, 0, 0, 11:15)
x

# NOTE: start indices: c(1, 6, 11)
# end indices: c(4, 8, 15)
indices <- mbte_default_indexer(x)
indices

# show first subsignal:
x[indices$start[1]:indices$end[1]] # c(1, 2, 3, 4)

mkerschbaumer/mbte documentation built on May 5, 2019, 11:01 p.m.