reconhub / incidence

☣:chart_with_upwards_trend::chart_with_downwards_trend:☣ Compute and visualise incidence
https://reconhub.github.io/incidence
Other
58 stars 13 forks source link

Is it possible to turn an incidence object to a dataframe and use this for plotting? #132

Closed kurttaylor closed 2 years ago

kurttaylor commented 2 years ago

Hi, is it possible to convert an incidence object into a dataframe and then use this for plotting? The reason I need to do this is because I have to export the file in CSV format out of a secure server (incidence objects not allowed and raw data not allowed - but monthly/weekly counts fine). e.g.

onset <- input_stage1$exp_date_covid19_confirmed

i <- incidence(onset, interval = "1 week: saturday")
plot(i, color = "darkred")

i_df <- as.data.frame(i)
incidence::plot(i_df)

I want to get the same plot for i_df as I in the example above.