library(shiny)
#a file with two columns, ds and y
MyDat <- read.csv("c:/users/fjcc/Documents/R/Play/FJCC_data.csv")
ui <- fluidPage(
numericInput("Mult", "Multiplier", value = 1),
tableOutput("TBL"),
plotOutput("Plot", width = "300px", height = "250px")
)
server <- function(input, output) {
NewDat <- reactive({
MyDat %>% mutate(y = y * input$Mult)
})
#Show the data with column y multiplied by the chosen value
output$TBL <- renderTable({
NewDat()
})
output$Plot <- renderPlot({
plot(NewDat()$ds, NewDat()$y)
})
}
shinyApp(ui, server)