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

Add the possibility to add extra information on special dates #83

Open jakobschumacher opened 5 years ago

jakobschumacher commented 5 years ago

See Figure 1 of this publication: https://www.eurosurveillance.org/content/10.2807/esm.02.05.00162-en In this epicurve can find additional information within the curve epicurve_with_special_dates when the mass campaign started and ended.

caijun commented 5 years ago

Recently I created a figure to show the significant difference between groups using ggsignif.(The following figure is from the website of ggsignif, not mine.)

image

The way to annotate significance is very similar to those additional information in the above figure. Therefore, we can adapt a similar way to implement the feature requested. Given a data.frame containing following variables

start.date: starting date (or position) of the annotation end.date: ending date (or position) of the annotation y: the height position of the annotation labels: information to be added

We can implement our own geom_annotate() function to add an annotation layer and control the color, font etc. of the additional information.