SlideShare a Scribd company logo
•
•
•
•
•
•
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
“R is a free software environment for
statistical computing and graphics.”
e GNU-Project: Open Source
e Based on “S” (programming language
developed by John Chambers at Bell-Labs)
e R Foundation: NPO for the development of R
§most widely used data analysis software - used by 2M +
data scientist, statisticians and analysts
§Most powerful statistical programming language
§flexible, extensible and comprehensive for productivity
•
•
•
•
•
© 2021 Dynamic Communities 15
•
© 2021 Dynamic Communities 16
Download,
save file,
double-click
17
© 2021 Dynamic Communities
Download,
save file,
double-click
18
© 2021 Dynamic Communities
Download,
save file,
double-click
19
© 2021 Dynamic Communities
Download,
save file,
double-click
20
© 2021 Dynamic Communities
CuRious about R in Power BI? End to end R in Power BI for beginners
• Mean – this is the average
• Median – splits the data in two halves
• Mode – the most popular value
• Variance – average squared difference between the data points
and the mean
• Standard Deviation – square root of the variance, more intuitive
• Percentiles – dataset is divided into 100 equal parts
• Quartiles – dataset is divided into four equal parts
• Interquartile range – middle 50% of data points
Advantages
• Free
• “Lingua franca” in methodological research: new statistical
procedures are often developed with R
• Large community: most problems are discussed on the internet
• No “point and click”: scripts make procedures transparent
and reproducible
• Flexible programming allows for automated replication with
new data
Drawbacks
• Not very intuitive
• No “Point and Click”: handling only through command line
and scripts
• Documentation is very technical at times
• Community-based: different developers (different, lacking
compatibility)
• Slow with very large data sets
CuRious about R in Power BI? End to end R in Power BI for beginners
Enter from command line
Ctrl + Enter from script
Assign variables:
x <- 2
Comments:
# Comment
Comment selection with Ctrl + Shift + c
FunctionName (arguments)
Function Effect
summary(x)
str(x)
head(x)
tail(x)
sum(x)
mean(x)
Summary information on x
Structure of x
Shows first 6 elements of x
Shows last 6 elements of x
Calculates the sum of a numeric vector
Calculates the arithmetic mean
CuRious about R in Power BI? End to end R in Power BI for beginners
Class Example
integer
numeric
character
logical
factor
date
complex
1, 2, 3
1.414, 3.14, 1.0
A, B, C TRUE,
FALSE
“A”, “1”, “rather correct”
date
complex numbers
sum(x) Sum of all elements
mean(x) Mean of all elements
prod(x) Product of all elements of x
diff(x) x2 − x1, x3 − x2, x4 − x3 etc.
x & y Logical AND
x | y Logical OR
!x Logical Negation
all(x) TRUE if all elements of x are TRUE
any(x) TRUE if at least one element of x is
TRUE
== Is equal to
!= Is not equal to
<,> Smaller than, Larger Than
<=, >= Smaller or equal, larger or equal
x in y Elements of x in y
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
c(1:4)
c("A","B","C")
ls <- list (1, 2, 3)
print (ls)
mx <- matrix (1:16, nrow = 4, ncol = 4)
print (mx)
•
•
•
•
str(df)
names
dim
CuRious about R in Power BI? End to end R in Power BI for beginners
•
•
Code Description
y ~ x
y ~ x1 + x2
y ~ x1 + x2 + 0 y ~
I(x1 + x2) y ~ . -
x1
y ~ x1 * x2
x has an effect on y
x1 and x2 have an effect on y
intercept set to zero
y is influenced by x1 plus x2
model of all variables except x1
interaction between x1 and x2
•
•
•
•
•
•
•
•
Let’s see the data!
Diamonds
Data Frame
Let’s see the data!
Remember to press the
‘Run’ button or select
CTRL + ENTER to run
the command
Results!
Let’s see the data!
This creates a new table
called PerfectDiamonds.
SELECT statements
allow you to choose the
columns you want.
Let’s see the data!
This creates a new table
called PerfectDiamonds
using a Filter to select
only perfect diamonds
Power BI
Import Data
Let’s start simple!
Add in an R
component
Add in an R
component
Script
Component
Appears in the
Power BI
Canvas
R Script goes here
Script
Component
Appears in the
Power BI
Canvas
R Script goes here
•
•
•
•
10
20
30
2 3 4 5 6 7
displ
ct
y
0.0
0.1
0.2
0.3
2 3 4 5 6 7
displ
densit
y
as.factor(year)
1999
2008
ggplot (data = mpg, aes (x = displ)) +
geom_density (aes (fill = as.factor(year)), alpha=0.5)
•
•
•
•
•
•
•
CuRious about R in Power BI? End to end R in Power BI for beginners
•
•
•
With ggmap map graphics can be generated.
•
•
•
https://shiny.rstudio.com/gallery/
•
•
•
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
Tidy code is easier to
write, read, maintain
and frequently even
faster than the base R
counterparts.
It is also easier to learn.
So here we are!
● Tidy Data is a standard approach to structure datasets
● Good for Data Analysis and Data Visualization
● Variables make up the columns
● Observations make up the rows
● Values go into cells
● A Variable is a measurement
● Also known as:
● Independent or dependent variables
● Features – this is Microsoft’s terminology
● Predictors – (machine learning background)
● Outcomes – (social sciences background)
● The Response (if you have a statistics background)
● Attributes (if you have a dimensional modelling background)
● A Variable can fall into three categories:
● Fixed Variables
● Known variables prior to the start of the investigation
● Measured Variables
● Data that’s captured during the investigative process
● Derived Variables
● Think of a calculated column in DAX or SQL
● Ingests data from different sources
● There are lots of options to work with the file
● Headers
● Limiters
● https://cran.r-project.org/web/packages/readr/readr.pdf for more information
● Easy data manipulation
● Built for data frames
● There are equivalents in SQL
● Written in C++ so it’s faster
● 6 verbs for data manipulation
● Select
● Filter
● Mutate
● group_by
● Summarize
● Tally
● There are equivalents in SQL
CuRious about R in Power BI? End to end R in Power BI for beginners
•
•
•
•
•
•
•
•
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
♡ ♡
CuRious about R in Power BI? End to end R in Power BI for beginners
•
•
•
•
•
•
•
•
•
•
•
•
•
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners

More Related Content

PDF
Introduction to Analytics with Azure Notebooks and Python
PDF
Multiplatform Spark solution for Graph datasources by Javier Dominguez
PDF
Serverless data pipelines gcp
PDF
A Production Quality Sketching Library for the Analysis of Big Data
PPSX
"Quantum Clustering - Physics Inspired Clustering Algorithm", Sigalit Bechler...
PDF
Scala: the unpredicted lingua franca for data science
PDF
Transitioning from Traditional DW to Apache® Spark™ in Operating Room Predict...
PDF
Data Science At Zillow
Introduction to Analytics with Azure Notebooks and Python
Multiplatform Spark solution for Graph datasources by Javier Dominguez
Serverless data pipelines gcp
A Production Quality Sketching Library for the Analysis of Big Data
"Quantum Clustering - Physics Inspired Clustering Algorithm", Sigalit Bechler...
Scala: the unpredicted lingua franca for data science
Transitioning from Traditional DW to Apache® Spark™ in Operating Room Predict...
Data Science At Zillow

What's hot (20)

PPTX
Data & analytics challenges in a microservice architecture
PDF
Spark Summit EU 2015: Combining the Strengths of MLlib, scikit-learn, and R
PDF
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
PDF
Build Real-Time Applications with Databricks Streaming
PDF
H2O World - H2O Rains with Databricks Cloud
PPTX
Data Science at Scale by Sarah Guido
PDF
Spark and the Future of Advanced Analytics by Thomas Dinsmore
PDF
How Spark Fits into Baidu's Scale-(James Peng, Baidu)
PDF
Signals from outer space
PDF
Spark's Role in the Big Data Ecosystem (Spark Summit 2014)
PDF
Building Better Analytics Workflows (Strata-Hadoop World 2013)
PPTX
Databricks @ Strata SJ
PDF
Building Data Lakes with Apache Airflow
PDF
Databricks + Snowflake: Catalyzing Data and AI Initiatives
PPTX
Building a Virtual Data Lake with Apache Arrow
PDF
Azure Databricks—Apache Spark as a Service with Sascha Dittmann
PPTX
Virtualizing Analytics with Apache Spark: Keynote by Arsalan Tavakoli
PPTX
DF1 - ML - Petukhov - Azure Ml Machine Learning as a Service
PPTX
Simplifying And Accelerating Data Access for Python With Dremio and Apache Arrow
PDF
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Data & analytics challenges in a microservice architecture
Spark Summit EU 2015: Combining the Strengths of MLlib, scikit-learn, and R
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
Build Real-Time Applications with Databricks Streaming
H2O World - H2O Rains with Databricks Cloud
Data Science at Scale by Sarah Guido
Spark and the Future of Advanced Analytics by Thomas Dinsmore
How Spark Fits into Baidu's Scale-(James Peng, Baidu)
Signals from outer space
Spark's Role in the Big Data Ecosystem (Spark Summit 2014)
Building Better Analytics Workflows (Strata-Hadoop World 2013)
Databricks @ Strata SJ
Building Data Lakes with Apache Airflow
Databricks + Snowflake: Catalyzing Data and AI Initiatives
Building a Virtual Data Lake with Apache Arrow
Azure Databricks—Apache Spark as a Service with Sascha Dittmann
Virtualizing Analytics with Apache Spark: Keynote by Arsalan Tavakoli
DF1 - ML - Petukhov - Azure Ml Machine Learning as a Service
Simplifying And Accelerating Data Access for Python With Dremio and Apache Arrow
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Ad

Similar to CuRious about R in Power BI? End to end R in Power BI for beginners (20)

PDF
R Programming - part 1.pdf
PDF
Machine Learning in R
PDF
Introduction to R for data science
PPT
Slides on introduction to R by ArinBasu MD
PPT
Basics of R-Progranmming with instata.ppt
PPT
PPT
17641.ppt
PPT
introduction to R with example, Data science
PPTX
DATA MINING USING R (1).pptx
PPT
How to obtain and install R.ppt
PPT
Introduction to R for Data Science Technology
PPTX
software engineering modules iii & iv.pptx
PPTX
Data Analytics with R and SQL Server
PDF
R programming & Machine Learning
PDF
SQLBits Module 2 RStats Introduction to R and Statistics
PDF
R programmingmilano
PPTX
Introduction to R - Basics of R programming, Data structures.pptx
PPTX
R language introduction
PPTX
Big data analytics with R tool.pptx
PPT
Advanced Data Analytics with R Programming.ppt
R Programming - part 1.pdf
Machine Learning in R
Introduction to R for data science
Slides on introduction to R by ArinBasu MD
Basics of R-Progranmming with instata.ppt
17641.ppt
introduction to R with example, Data science
DATA MINING USING R (1).pptx
How to obtain and install R.ppt
Introduction to R for Data Science Technology
software engineering modules iii & iv.pptx
Data Analytics with R and SQL Server
R programming & Machine Learning
SQLBits Module 2 RStats Introduction to R and Statistics
R programmingmilano
Introduction to R - Basics of R programming, Data structures.pptx
R language introduction
Big data analytics with R tool.pptx
Advanced Data Analytics with R Programming.ppt
Ad

More from Jen Stirrup (20)

PPTX
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
PDF
AI Applications in Healthcare and Medicine.pdf
PPTX
BUILDING A STRONG FOUNDATION FOR SUCCESS WITH BI AND DIGITAL TRANSFORMATION
PPTX
Artificial Intelligence Ethics keynote: With Great Power, comes Great Respons...
PDF
1 Introduction to Microsoft data platform analytics for release
PDF
5 Comparing Microsoft Big Data Technologies for Analytics
PDF
Comparing Microsoft Big Data Platform Technologies
PDF
Sales Analytics in Power BI
PDF
Analytics for Marketing
PDF
Diversity and inclusion for the newbies and doers
PDF
Artificial Intelligence from the Business perspective
PDF
How to be successful with Artificial Intelligence - from small to success
PDF
Artificial Intelligence: Winning the Red Queen’s Race Keynote at ESPC with Je...
PDF
Data Visualization dataviz superpower
PDF
R - what do the numbers mean? #RStats
PDF
Artificial Intelligence and Deep Learning in Azure, CNTK and Tensorflow
PPTX
Blockchain Demystified for Business Intelligence Professionals
PDF
Examples of the worst data visualization ever
PPTX
Lighting up Big Data Analytics with Apache Spark in Azure
PPTX
Digital Transformation for the Human Resources Leader
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
AI Applications in Healthcare and Medicine.pdf
BUILDING A STRONG FOUNDATION FOR SUCCESS WITH BI AND DIGITAL TRANSFORMATION
Artificial Intelligence Ethics keynote: With Great Power, comes Great Respons...
1 Introduction to Microsoft data platform analytics for release
5 Comparing Microsoft Big Data Technologies for Analytics
Comparing Microsoft Big Data Platform Technologies
Sales Analytics in Power BI
Analytics for Marketing
Diversity and inclusion for the newbies and doers
Artificial Intelligence from the Business perspective
How to be successful with Artificial Intelligence - from small to success
Artificial Intelligence: Winning the Red Queen’s Race Keynote at ESPC with Je...
Data Visualization dataviz superpower
R - what do the numbers mean? #RStats
Artificial Intelligence and Deep Learning in Azure, CNTK and Tensorflow
Blockchain Demystified for Business Intelligence Professionals
Examples of the worst data visualization ever
Lighting up Big Data Analytics with Apache Spark in Azure
Digital Transformation for the Human Resources Leader

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The AUB Centre for AI in Media Proposal.docx
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Programs and apps: productivity, graphics, security and other tools
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

CuRious about R in Power BI? End to end R in Power BI for beginners