If your lollipop plot goes on both side of an interesting threshold, you probably want to change the color of its components conditionally. You can do it easily with ggplot2 and the tidyverse. First, add a new column to your dataframe specifying if you are over or under the threshold. This is usually done using the ifelse function (see code). Then, give this column to the color aesthetic.






Make a search



Leave a Reply

Notify of