Automatic Highlighting Outliers in ggplots

I have a dataframe df. While plotting this in ggplot. Can we also highlight outliers. Below is the sample code

df <- data.frame(col=runif(100, min=0, max=100000))
df$D <- c(1:100)

Using the gghighlight package you can set whatever predicate you like for highlighting:

There are also examples of how to do this manually at the links below:

This one is for adding labels to certain points, but the principles are the same


Perfect and thanks a lot. For other users, below link I used to solve this problem

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.