Skip to contents

The function wave_extract subsets data and returns the specified waveform.

Usage

wave_extract(data, wave, number = 1)

Arguments

data

A dataframe containing three columns: time, volts, waveform.

wave

Desired type of waveform, e.g. pd1

number

Integer denoting which instance of the specified waveform type to select - e.g. number = 1 will select the first instance of waveform type specified by wave parameter.

Value

A list containing 2 entries is returned: entry one is a tibble of time, volts, waveform is returned containing just the specified waveform instance. List entry 2 is the number/count of that type of waveform - e.g. if wave = "pd2" and there are 12 pd2 instances in the dataset, this entry will return 12.

Details

If the wave parameter input does not exactly match a waveform label in the data, the function will not work.

See also

Other waveform functions: plot_pie(), plot_wave(), wave_duration(), wave_occurrence(), wave_topfreq(), wave_volts()