BLOG R With PowerBI: A Step-by-Step Guide

30-05-2019  0 Comment(s)

There's been a lot of interest everywhere on how to integrate R scripts with Microsoft PowerBI dashboards. Here is a step by step guide to this.

Lets assume that you have some readymade R code available, for example, with the ggplot2 library. Lets use the following scripts to perform analytics using CHOL data.

Open R studio or R Package (CRAN) & install ggplot2 library first.

install.packages(‘ggplot2’)
library(ggplot2)
#Take the column “AGE” from the “chol” dataset and make a histogram it
qplot(chol\$AGE , geom = “histogram”)
ggplot(data-chol, aes(chol\$AGE)) + geom_histogram()
1. Paste the following R script and execute it:
qplot(chol\$AGE,
geom = “histogram”,
binwidth = 0.5)
1. Next, execute the following pieces of R code to find out the binwidth argument using the ‘qplot()‘ function:
#Lets take help from hist() function
qplot(chol\$AGE,
geom=”histogram”,
binwidth = 0.5,
main = “Histogram for Age”,
xlab = “Age”,
fill=I(“blue”))
1. Lets get some help from the hist() function in R:
#Add col argument, I() function where nested color.
qplot(chol\$AGE,
geom=”histogram”,
binwidth = 0.5,
main = “Histogram for Age”,
xlab = “Age”,
fill=I(“blue”),
col=I(“red”))
1. Now, add an I() function for nested colors:

Comment Here       