I am trying to add some annotated text on time series data, in simpler terms something that looks like
Red Line: _INSERT CURRENT VALUE OF MOST RECENT DATE_
Black Line: _INSERT CURRENT VALUE OF MOST RECENT DATE_
Dashed Line: 0.014
I tried annotating some text in my ggplot using the following code, but nothing appeared on my plot so I'm not sure why it wasn't working. This is what I was using
@Z3tt Thank you this is what I was looking for, I have a followup question, if I wanted to show the most recent value, for the most recent date in the time series beside the text, is this possible? and what would the correct syntax be. This is the block of code I am using for the ggpplot.
I'd like it beside the labels of "calculated CFR" and "Estimated CFR"
You can use either paste() or glue::glue() to vcombine strings with values. This snippet should work. (Unfortunately, I can't try it since you did not share your data.)