# NOT RUN {
# Create a SparkDataFrame from the Iris dataset
irisDF <- createDataFrame(iris)
# Compute histogram statistics
histStats <- histogram(irisDF, irisDF$Sepal_Length, nbins = 12)
# Once SparkR has computed the histogram statistics, the histogram can be
# rendered using the ggplot2 library:
require(ggplot2)
plot <- ggplot(histStats, aes(x = centroids, y = counts)) +
geom_bar(stat = "identity") +
xlab("Sepal_Length") + ylab("Frequency")
# }
Run the code above in your browser using DataLab