temp_file <- tempfile(fileext = ".txt")
cat(sim_RRi$RRi_simulated,
file = temp_file,
sep = "\n")
sim_data <- import_RRi_txt(file = temp_file,
remove_ectopic = TRUE,
filter_noise = FALSE,
min = 250, max = 2000)
head(sim_data)
library(ggplot2)
ggplot(sim_data, aes(time, RRi)) +
geom_line(linewidth = 1/4, col = "purple") +
labs(x = "Time (min)", y = "RRi (ms)",
title = "Processed RRi Signal") +
theme_minimal()
Run the code above in your browser using DataLab