How can I dynamically change a custom plot annotation in gganimate with relation to transition states, similar to Change label of gganimate frame title, but the annotation should be placed within the plot panel. Animated barplot via gganimate: Annotate box with changing text below plot is similar, but the annotation here is simpler, as it directly relates to the transition states.
library(gganimate)
#> Loading required package: ggplot2
df <- data.frame(y = letters[1:6], x = c(1:6))
p <-
ggplot(df, aes(x, y)) +
geom_col()
p_anim <- p + transition_states(y) + shadow_mark()
## the desired outcome is an annotation which changes according to the transition state.