I want to label only the outliers. This is the code that I did. I don't know a way to label only the outliers. It labels for all the points and makes the plot messy.
The STATE column has the US state names. I want to display only the states only that are outliers.
p <-ggplot(data, aes(x=1, y=data$fact,label = STATE)) +geom_point(shape=1) +geom_boxplot() + geom_text(aes(label=STATE))
plot <- ggplotly(p)
I want the labels to be displayed only for STATE - MA, RI and CT that are the outliers. Any suggestions? The plot result that I currently get,