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

Plotting the data using ggplot

If you like using ggplot, a similar set of graphs can be rendered using facets:

require("ggplot2").df <- data.frame(x = x3$Year.1, y = x3$Not.Covered.Pct, z = x3$cat, s = x3$cat).df <- .df[order(.df$x), ].plot <- ggplot(data = .df, aes(x = x, y = y, colour = z, shape = z))+ geom_point()+      geom_line(size = 1) + scale_shape_manual(values = seq(0, 15))+ scale_y_continuous(expand = c(0.01, 0)) + facet_wrap(~s) + xlab("Year.1") + ylab("Not.Covered.Pct") + labs(colour = "cat", shape = "cat") + theme(panel.margin = unit(0.3, "lines"), legend.position = "none") print(.plot) 

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