O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding labels

It can sometimes be a bit difficult to discern the differences between the categories based on the legend, especially as the number of categories increases, so we can use the directlables library to mark each line with the category name. Now we can see, for example, that ALL MALES has a higher uninsured rate than ALL FEMALES over all time periods:

#install.packages("directlabels")library(directlabels)direct.label(.plot, list(last.points, hjust = 0.75, cex = 0.75, vjust = 0)) 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required