fix_repeating_values: Remove repeating instances of the same sample

View source: R/fix_waveforms.R

fix_repeating_valuesR Documentation

Remove repeating instances of the same sample

Description

A device may only return a value every 20 seconds. If data is represented with 2 sec intervals, 9/10 are just repeats. This function takes a dataframe with repeating values, and tries to only return 1 observation per measured value.

Usage

fix_repeating_values(df, expected_interval = 20, max_difftime = 25)

Arguments

df

Signal to fix (data frame)

expected_interval

The interval expected from the device.

max_difftime

If the interval between two changes is higher than max_timediff, this is interpreted as representing multiple true measurements.

Details

eg. Vital recorder saves EV1000 samples every other second. Data is only calculated every 20 seconds. This function tries to match these 20 second samples.

Value

Dataframe with only relevant values (1 every 20 seconds)


JohannesNE/waveformtools documentation built on July 1, 2022, 8:48 p.m.