Max Mendez L
10.08.2020
# 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–>
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