I want to import a dataset by user and edit some cells inside the r script like change the third cell to 99, but it will show the error message: Error : cannot coerce class ""function"" to a data.frame.
server <- function(input, output) {
output$contents <- renderTable({
req(input$file1)
df <- read.csv(input$file1$datapath,
header = input$header,
sep = input$sep)
df[1,3]=99
df
})
output$downloadData<-downloadHandler(
filename=function(){
paste("data",".csv",sep="")
},
content=function(file){
write.csv(df,file)
}
)
}