Learn R Programming

beats (version 0.1.1)

animate_hr: Animate ECG data and heart beats

Description

animate_hr produces a GIF of heart beats in (close to) real time.

Usage

animate_hr(ecg, beats, which_beats = NULL, big = FALSE)

Arguments

ecg

A data.frame with columns timestamp (POSIXct) and ecg (numeric) (see read_ube)

beats

A data.frame with columns timestamp (POSIXct), ecg, period_s, freq_hz, and freq_bpm (see find_hr)

which_beats

Indices of the heart beats (in param beats) to be animated. If NULL (default), all beats will be animated.

big

If FALSE (default) then throw an error if the animation will last more than 20s. This prevents R from crashing if it tries to animate too much.

Value

A gif_image object

Examples

Run this code
# NOT RUN {
  animate_hr(ecg_bw190918_62R, beats_bw190918_62R, which_beats = 44:50, big = TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab