General Information about the ECG App

Max Mendez L
10.08.2020

  • This is an App that allows the import, clean and analysis of the Heart Rate from an Electrocardiogram.
  • Provided are two set of examples: one “Control” and one “Experiment”.
  • It takes .csv files as an input.
  • This is only the first part of the App, as it needs more work to be able to be fully be functional.
# This is the start of a project to read, clean and evaluate Heart Rate and ECG.
# Provided is an example recorded at FS=10000.
# This first part is to load, and visualise a normal electrocardiogam.

library(shiny)
library(shinydashboard) 
library(ggplot2)

#Example Data
Control <- read.csv("Control.csv", sep=";", header=FALSE) #change "," to ";" accordingly
Experiment <- read.csv("Experiment.csv", sep=";", header=FALSE)

# Define UI for application that draws plot
shinyUI(fluidPage(

        titlePanel("Heart Rate"),
                        sidebarPanel(
                        selectInput(inputId= "Control" , label = "SelectData", choices = c("Control", "Experiment"), selected="NULL"), 
                        submitButton("Go")),
                        mainPanel(plotOutput("Plot1"))
                                  )
)

<!–html_preserve–>

Heart Rate

</div><!--/html_preserve-->

library(shiny)
library(ggplot2)
library(plyr)
library(dplyr)
library(plotly)
library(forecast)

shinyServer(function(input, output) {

        Data <- reactive({
                if (input$Control  == "Control")
                {
                        return(Control)


                }
                else 
                {
                        return(Experiment)
                }
        })

        output$Plot1 <- renderPlot({
                if ( input$Control == "Control") {
                ggplot(Data(), aes(x = Control$V1, y=Control$V2)) + theme_classic() + xlim(25,30) + 
                        geom_line()

                        } else {

                 if ( input$Control == "Experiment") {
                ggplot(Data(), aes(x = Experiment$V1, y=Experiment$V2)) + theme_classic() + xlim(25,30) +
                        geom_line() }
                                         }



})

})

```

Example plot generated

plot of chunk unnamed-chunk-3plot of chunk unnamed-chunk-3

Thank you