cis-ds / dataviz

3 stars 21 forks source link

Output object problem #53

Closed jonathanecm closed 7 years ago

jonathanecm commented 7 years ago

This code runs fine with I run the Rmd document. But when in use the runfile.R it gives me the following error:

Quitting from lines 38-61 (02_report.Rmd) Error in output$downloadCSV <- downloadHandler(filename = "data.csv", : object 'output' not found

Code

Set up data download

data_for_dl <- reactive({ dat <- select(countries_density, country, continent = continent.x, lifeExp, pupulation = pop, areaInSqKm, pop_density) })

output$downloadCSV <- downloadHandler( filename = 'data.csv', content = function(file) { write_csv(data_for_dl(), file) } )

bensoltoff commented 7 years ago

Did you define output somewhere in your code? When using flexdashboard with shiny, I don't believe all your output objects have to be stored in output, so you would need to explicitly create it in your code.