I have created the following dataframe using R
datelist<-seq(as.Date('2011-01-01'),as.Date('2011-01-31'),by = 1)
df<-as.data.frame(datelist)
df$New<-1:nrow(df)
Next I have created a UI and Server using shiny to read the table
library(shiny)
UI<-fluidPage(fileInput("file", "Browse",
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv")),dateInput(inputId = "Cutoffdate",
label = "Cut Off Date"),
tableOutput(outputId = "Table1"))
Server<-function(input, output, session){
options(shiny.maxRequestSize=100*1024^2)
output$Table1<-renderTable({
infile <- input$file
if (is.null(infile)) {
# User has not uploaded a file yet
return(NULL)
}
df<-readxl::read_xlsx(input$file$datapath)
})
shinyApp(UI, Server)
Instead of Year month date the table output gives a series of numbers. I have tried using ymd from lubridate but that doesn't help. Is there a way to coax the data into ymd inside the reactive environment in R
as.Date
inside R – Rohitdf
to excel/csv after creating it? And then reading it back in R? – Vishesh Shrivastav