Skip to main content
100%

R flavoured Kmeans algorithm in Power Query

✓ Published0🌍 Public
HHugoberry
Last edited Mar 9, 2017
Created on Mar 9, 2017

This example demonstrates the R-flavored K-means clustering algorithm executed directly within Power Query, using the iris dataset’s petal width and length columns to assign cluster memberships. The visualization shows the resulting iris data points colored by their assigned cluster, with the clustering computed in R via the `kmeans` function and seeded for reproducibility. The Power Query M code invokes the R engine through the `R.Execute` API, passing a script that runs K-means with three centers and twenty random starts, then returns the augmented table containing the cluster labels. The underlying data originates from the built-in iris dataset, and the rendering relies on Power Query’s native table output, not a separate charting library.

AI-generated description

Similar vizzes