## POWER BI: R-Visuals

#### The Basics: R-Visuals

Power BI also lets you make power visualization in R. R is a widely used statistical computing language which can be downloaded here A common type of plot used in R is a graphical display of a correlation matrix. A correlation matrix is a visual representation of how each variable is linearly related. Essentially you have a matrix ( a table of values with rows and columns) where each cell corresponds to how well each of the variables correlate.The graph below illustrates this concept using NHL hockey data:

This correlation matrix shows how well player points, age, misses, major penalties, assists, goals and salary are linearly related to each other. The diagonal on the matrix will always be a perfect 1-1 linear correlation since points will be perfectly correlated with points, age will be perfectly correlated with age and so on. The darker the shade of blue the stronger the positive correlation. We can see (not suprisingly), that points have a strong positive correlation with assists and with goals. That is if points go up and so do goals! Goals scored and salary have a roughly moderate correlation while salary and major penalties have no correlation whatsoever.

##### How to make the r visual above:

In Power BI in your R script visual enter the following lines of code:


require (" corrplot" )
library (corrplot)
M <–cor(dataset)
corrplot (M, method = " color" , tl.cex = 1.5, tl.srt = 100, tl.col= "black")
#corrplot (M, method = " circle" , type = "upper", tl.cex = 1.5, tl.srt =100, t.col = " black" )
#corrplot (M, method = " circle" , tl.cex = 1.5, tl.srt =100, tl.col =" black" , type = " upper" , order =" hclust" )



• SEO