From the course: Machine Learning with Data Reduction in Excel, R, and Power BI

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Creating custom code with R standard visual

Creating custom code with R standard visual

- Within Power BI Desktop, we can also set up the standard R visual using custom R code. Here's an example of a hierarchical clustering model that results in a dendrogram. I would like to use this clustering dendrogram in Power BI. To do so, I'm going to take a look the pieces of code I need to create the visual. But first I'm going to go into Power BI Desktop, and set up the framework for the R visual. Setting up the R visual is a multi-part process. First let's create a table visual, that stores the fields we want to use in the R visual. I'm going to select all of the fields from the averages data frame. That's now its own table and Power BI as fields in this model. Once we've added the fields to our table visual, let's make sure the numbers aren't aggregated. I'm going to take the totals off. Next we'll convert our table visual into the standard R visual. Below in the R script editor is where we'll copy our code from…

Contents