I am trying to build a simply Shiny app, which can take data input from a CSV file and then display the data along with a ts plot, here is the R code that I have written,
ui.R file
library(shiny)
shinyUI <- fluidPage(
titlePanel(h2("Blood Test Result System",align = "center")),
sidebarLayout(
sidebarPanel(
selectInput(inputId = "dataset",
label = "Choose a blood value:",
choices = c("Albumin","Bilirubin","CL(KLOR)","Glukoz","Kalsiyum","Kolesterol",
"Kreatinin","Potasyum","Protein","Trigliserid","Hdl Kolesterol","Kreatin Kinaz"))),
mainPanel(
verbatimTextOutput("summary"),
tableOutput("view"))))
server.R file
library(shiny)
shinyServer(
function(input,output){
datasetInput <- reactive({
switch(input$dataset,
"Albumin"=albumin,
"Bilirubin"=biliribun,
"CL(KLOR)"=clklor,
"Glukoz"=glukoz,
"Kalsiyum" = kalsiyum,
"Kolesterol" = kolesterol,
"Kreatinin" = kreatinin,
"Kreatin Kinaz" = kreatinkinaz,
"Potasyum" = potasyum,
"Protein" = protein,
"Trigliserid"=trigliserid,
"Hdl Kolesterol"=hdlkolesterol,
"Kreatin Kinaz"=kreatinkinaz)
})
# Generate a summary of the dataset ----
output$summary <- renderPrint({
dataset <- datasetInput()
summary(dataset)
})})
How can i implement ps plot with blood test value and their dates?I have 13 blood values as data frame (date,value_name,result,unit, interval) like (2019-01-28,Potassium,4.00,mmol/L,3.5-5.2)