Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

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.

 

 

 

Related


 

Make a search


 

 


Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz