При создании блестящего приложения для получения фрейма данных в соответствии с вводом пользователя я использую следующее, которое отлично работает:
library(shiny)
ui <- fluidPage(
textInput("name", "Comnnay Name"),
textInput("income", "Income"),
textInput("expenditure", "Expenditure"),
dateInput("date", h3("Date input"),value = Sys.Date() , min = "0000-01-01",
max = Sys.Date(), format = "dd/mm/yy"),
#Table showing what is there in the data frame
tableOutput("table"),
#Button which appends row to the existing dataframe
actionButton("Action", "Submit"),
#Button to save the file
downloadButton('downloadData', 'Download')
)
library(shiny)
server <- function(input, output){
#Global variable to save the data
Data <- data.frame()
Results <- reactive(data.frame(input$name, input$income, input$expenditure,
input$date , Sys.Date()))
#To append the row and display in the table when the submit button is clicked
observeEvent(input$Action,{
#Append the row in the dataframe
Data <<- rbind(Data,Results())
#Display the output in the table
output$table <- renderTable(Data)
})
output$downloadData <- downloadHandler(
# Create the download file name
filename = function() {
paste("data-", Sys.Date(), ".csv", sep = "")
},
content = function(file) {
write.csv(Data, file) # put Data() into the download file
})
}
shinyApp(ui = ui, server = server)
Но когда я нажимаю кнопку отправки, он не печатает дату в желаемом формате.

Что мне делать, чтобы изменить версию вывода. Или надо что-то специально указывать? Спасибо.





Все даты на большинстве языков являются числовыми, что вполне естественно. Если вы хотите, чтобы строка просто проанализировала ее
Results <- reactive(data.frame(input$name, input$income, input$expenditure,
as.character(input$date), as.character(Sys.Date())))