{directlabels} lets you attach categorical labels to many plots. for labeling values on plots, use ggrepel:
suppressPackageStartupMessages({
library(ggplot2)
library(ggrepel)
library(dplyr)
})
extrema <-
economics %>%
slice(which.max(date), which.min(date))
economics %>%
ggplot(aes(date, psavert)) +
geom_line() +
geom_text_repel(
data = extrema,
aes(date, psavert, label = psavert),
nudge_y = 1,
min.segment.length = Inf
)
Created on 2020-03-05 by the reprex package (v0.3.0)