library("hfmAnnotation")
library("magrittr")
library("purrr")
library("testthat")
library("stats")
library("assertthat")
library("seewave")
context("wavelet-ECG-annotation with constant zero input signal")
ecg <- rep(0, 60000)
sampling_frequency <- 250
test_that("wavelet-ECG-annotation won't crash", {
wavelet_ECG_annotation(ecg, sampling_frequency) %>%
expect_error(NA)
})
test_that("wavelet-ECG-annotation returns no R-peak", {
wavelet_ECG_annotation(ecg, sampling_frequency) %>%
extract2("R_peak") %>%
expect_equal(c())
})
test_that("wavelet-ECG-annotation returns no Q-wave", {
wavelet_ECG_annotation(ecg, sampling_frequency) %>%
extract2("Q_peak") %>%
expect_equal(c())
})
context("wavelet-ECG-annotation with constant non-zero input signal")
ecg <- rep(10, 60000)
sampling_frequency <- 250
test_that("wavelet-ECG-annotation won't crash", {
wavelet_ECG_annotation(ecg, sampling_frequency) %>%
expect_error(NA)
})
test_that("wavelet-ECG-annotation returns no R-peak", {
wavelet_ECG_annotation(ecg, sampling_frequency) %>%
extract2("R_peak") %>%
expect_equal(c())
})
test_that("wavelet-ECG-annotation returns no Q-wave", {
wavelet_ECG_annotation(ecg, sampling_frequency) %>%
extract2("Q_peak") %>%
expect_equal(c())
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.