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 using ggplot

If you prefer to use ggplot to plot your results, load the ggplot2 package to run your plots directly against the Spark dataframe. You will have more of an opportunity for further customization:

Here is a basic ggplot which corresponds to the histogram() functions illustrated above:

require(ggplot2) plot <- ggplot(age_hist, aes(x = centroids, y = counts)) +        geom_bar(stat = "identity") +       xlab("mass") + ylab("Frequency")   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