read_csv requires library(readr). Your ui brackets were also mistmatched. Your input ids "xxx" need to match what you call with input$xxx. And looks like you need to use DTOutput.
library(shiny)
library(DT)
library(readr)
rate <- read_csv("FITB.csv")
# Define UI
ui <- fluidPage(
# Appl title
titlePanel("Fifth Third Stock price"),
# Sidebar with a slider input for number of bins
# dateRangeInput('dateRange',
# label = 'Date range input: yyyy-mm-dd',
# start = 2018-11-12, end = 2019-11-12, min = 2018-11-12, max = 2019-11-12, weekstart = 1
# )
# )
sidebarLayout(
sidebarPanel(
dateRangeInput("dateRange", label = h3("Date Range"), start = "2018-11-12", end = "2019-11-12"),
selectInput("variable", "What do you want to see:", choices = c("Open", "High", "Low", "Volume")),
actionButton("update", "Update table")
),
mainPanel(
DTOutput("table")
)
)
)
# Define server
server <- function(input, output) {
# output$distPlot <- renderPlot({
# generate dates and table
output$dateRangeText <- renderText({
paste(
"input$dateRange is",
paste(as.character(input$dateRange), collapse = " to ") # name must match the input
)
})
output$table <- renderDT({
rate
},
class = "display nowrap compact", filter = "top"
) # location of column filters
}
# Run the application
shinyApp(ui = ui, server = server)