SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Dashboard Development in R
Rick Wargo
@rickwargo
• Works at InfoMC, Inc.
Director, Architecture and Development
• You’ll see me
• At the beach
• Behind the camera
• Cooking
• Developing
• Exploring
• Frolicking with my family
• Published R package – lrequire (makes dashboard development easier)
• One of the original ten Alexa Champions
• Presentation available at
https://www.rickwargo.com/dashboard-development-in-r/
Why Dashboards in R?
Why R?
• Data Acquisition is Easy
• CSV, XML, DB, REST, …
• Libraries-a-Plenty
• Graphing, Analytics, Machine Learning,
Dashboarding, …
• Established Practices for
• Getting and Cleansing Data (“tidy”)
• Reproducibility
• Peer Review
Data Acquisition
Let’s Use Apple Health Data - Steps
Data Acquisition from Analytics Playbook
Export Health Data from iPhone
1
3
2
Get Data Presentation Ready
• Acquire data
• Clean and Tidy
• Tidy: Get the data in a format that is easy to
manipulate, model, and visualize
• observations are in rows
• variables are in columns
• contained in a single dataset
• Augment
apple_health_data.R
library(lubridate)
library(XML)
# load apple health export.xml file
xml <- xmlParse("~/Code/R/AppleHealthData/apple_health_export/export.xml")
# transform xml file to data frame - select the Record rows from the xml file
steps.df <- XML:::xmlAttrsToDataFrame(xml['//Record[@type="HKQuantityTypeIdentifierStepCount"]'], stringsAsFactors = FALSE)
# make value variable numeric
steps.df$value <- as.numeric(steps.df$value)
# make endDate in a date time variable POSIXct using lubridate with eastern time zone
steps.df$endDate <- ymd_hms(steps.df$endDate, tz="America/New_York")
# augment data - add in year month date dayofweek hour period columns
steps.df$month <- format(steps.df$endDate,"%m")
steps.df$year <- format(steps.df$endDate,"%Y")
steps.df$date <- format(steps.df$endDate,"%Y-%m-%d")
steps.df$dayofweek <- wday(steps.df$endDate, label=TRUE, abbr=FALSE)
steps.df$hour <- format(steps.df$endDate,"%H")
steps.df$period <- format(steps.df$endDate, "%Y-%m")
steps.df <- steps.df[steps.df$period>"2016-09",]
module.exports <- list(steps=steps.df, summary=summary.df)
Consume the Data
library(lrequire)
df <- lrequire(apple_health_data)
or
df <- lrequire(apple_health_data, force.reload = TRUE)
Let’s see this in R!
Dashboards
Dashboard Tools in R
Shiny
• Host on your own servers or on Rstudio’s hosting service
• No web development skills required, but you can if you desire
• shinydashboard -- install.packages("shinydashboard")
• shinythemes -- install.packages("shinythemes")
• Extensible
flexdashboard for R
• Uses R Markdown for publication (knitr is another great option)
plotly Dashboards ($$)
• Beautiful, publication-quality graphics
• API’s for multiple languages including R, Python, Matlab, …
Create a Shiny Dashboard
• From R Studio, create a Shiny Web App
• Run app locally (to test)
• Publish to share with small team – other hosting options available
Examples
• Streaming CRAN data
• Twin Cities Buses
My Apple Health Data Shiny Dashboard
Create a flexdashboard
Send an email via R Markdown/knitr
Create a Plotly Graph
Serve a Dashboard in Slack
More Learning
Coursera – Data Science Specialization
R Libraries
• lrequire: Sources an R "Module" with Caching &
Encapsulation, Returning Exported Vars
Contact Me
https://www.rickwargo.com/
https://github.com/rickwargo
https://linkedin.com/in/rickwargo
contact@epicminds.com
@rickwargo

Weitere ähnliche Inhalte

Ähnlich wie Sql Saturday #638 - Dashboard Development in R

Machine Learning Models in Production
Machine Learning Models in ProductionMachine Learning Models in Production
Machine Learning Models in ProductionDataWorks Summit
 
The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)Simon Willison
 
Borden_resume_1JUN16
Borden_resume_1JUN16Borden_resume_1JUN16
Borden_resume_1JUN16Gary Borden
 
Building the Foundations of an Intelligent, Event-Driven Data Platform at EFSA
Building the Foundations of an Intelligent, Event-Driven Data Platform at EFSABuilding the Foundations of an Intelligent, Event-Driven Data Platform at EFSA
Building the Foundations of an Intelligent, Event-Driven Data Platform at EFSADatabricks
 
Automatisation in development and testing - within budget [IronCamp prague 20...
Automatisation in development and testing - within budget [IronCamp prague 20...Automatisation in development and testing - within budget [IronCamp prague 20...
Automatisation in development and testing - within budget [IronCamp prague 20...David Lukac
 
R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...
R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...
R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...Edureka!
 
Druid: Under the Covers (Virtual Meetup)
Druid: Under the Covers (Virtual Meetup)Druid: Under the Covers (Virtual Meetup)
Druid: Under the Covers (Virtual Meetup)Imply
 
Agile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDBAgile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDBRussell Jurney
 
Machine Learning, Key to Your Classification Challenges
Machine Learning, Key to Your Classification ChallengesMachine Learning, Key to Your Classification Challenges
Machine Learning, Key to Your Classification ChallengesMarc Borowczak
 
Ted Willke, Intel Labs MLconf 2013
Ted Willke, Intel Labs MLconf 2013Ted Willke, Intel Labs MLconf 2013
Ted Willke, Intel Labs MLconf 2013MLconf
 
DBA_Kuppam_Saikrishna_B-Tech (1)
DBA_Kuppam_Saikrishna_B-Tech (1)DBA_Kuppam_Saikrishna_B-Tech (1)
DBA_Kuppam_Saikrishna_B-Tech (1)sai krishna
 
Offshore Recruiting Training Material
Offshore Recruiting Training MaterialOffshore Recruiting Training Material
Offshore Recruiting Training Materialjohnpaka
 
Yahoo! Hack India: Hyderabad 2013 | Building Data Products At Scale
Yahoo! Hack India: Hyderabad 2013 | Building Data Products At ScaleYahoo! Hack India: Hyderabad 2013 | Building Data Products At Scale
Yahoo! Hack India: Hyderabad 2013 | Building Data Products At ScaleYahoo Developer Network
 
Best Practices for Building and Deploying Data Pipelines in Apache Spark
Best Practices for Building and Deploying Data Pipelines in Apache SparkBest Practices for Building and Deploying Data Pipelines in Apache Spark
Best Practices for Building and Deploying Data Pipelines in Apache SparkDatabricks
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery GuideMark Rackley
 
Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...
Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...
Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...Sergii Khomenko
 

Ähnlich wie Sql Saturday #638 - Dashboard Development in R (20)

Machine Learning Models in Production
Machine Learning Models in ProductionMachine Learning Models in Production
Machine Learning Models in Production
 
The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)
 
Borden_resume_1JUN16
Borden_resume_1JUN16Borden_resume_1JUN16
Borden_resume_1JUN16
 
Building the Foundations of an Intelligent, Event-Driven Data Platform at EFSA
Building the Foundations of an Intelligent, Event-Driven Data Platform at EFSABuilding the Foundations of an Intelligent, Event-Driven Data Platform at EFSA
Building the Foundations of an Intelligent, Event-Driven Data Platform at EFSA
 
Automatisation in development and testing - within budget [IronCamp prague 20...
Automatisation in development and testing - within budget [IronCamp prague 20...Automatisation in development and testing - within budget [IronCamp prague 20...
Automatisation in development and testing - within budget [IronCamp prague 20...
 
R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...
R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...
R Tutorial For Beginners | R Programming Tutorial l R Language For Beginners ...
 
Mstr meetup
Mstr meetupMstr meetup
Mstr meetup
 
Druid: Under the Covers (Virtual Meetup)
Druid: Under the Covers (Virtual Meetup)Druid: Under the Covers (Virtual Meetup)
Druid: Under the Covers (Virtual Meetup)
 
R- Introduction
R- IntroductionR- Introduction
R- Introduction
 
Agile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDBAgile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDB
 
Machine Learning, Key to Your Classification Challenges
Machine Learning, Key to Your Classification ChallengesMachine Learning, Key to Your Classification Challenges
Machine Learning, Key to Your Classification Challenges
 
Ted Willke, Intel Labs MLconf 2013
Ted Willke, Intel Labs MLconf 2013Ted Willke, Intel Labs MLconf 2013
Ted Willke, Intel Labs MLconf 2013
 
SAP
SAPSAP
SAP
 
DBA_Kuppam_Saikrishna_B-Tech (1)
DBA_Kuppam_Saikrishna_B-Tech (1)DBA_Kuppam_Saikrishna_B-Tech (1)
DBA_Kuppam_Saikrishna_B-Tech (1)
 
Offshore Recruiting Training Material
Offshore Recruiting Training MaterialOffshore Recruiting Training Material
Offshore Recruiting Training Material
 
Yahoo! Hack India: Hyderabad 2013 | Building Data Products At Scale
Yahoo! Hack India: Hyderabad 2013 | Building Data Products At ScaleYahoo! Hack India: Hyderabad 2013 | Building Data Products At Scale
Yahoo! Hack India: Hyderabad 2013 | Building Data Products At Scale
 
ETL
ETL ETL
ETL
 
Best Practices for Building and Deploying Data Pipelines in Apache Spark
Best Practices for Building and Deploying Data Pipelines in Apache SparkBest Practices for Building and Deploying Data Pipelines in Apache Spark
Best Practices for Building and Deploying Data Pipelines in Apache Spark
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...
Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...
Building Ranking Infrastructure: Data-Driven, Lean, Flexible - Sergii Khomenk...
 

Kürzlich hochgeladen

Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...HyderabadDolls
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...nirzagarg
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Klinik kandungan
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...nirzagarg
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdfkhraisr
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...gajnagarg
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...HyderabadDolls
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxronsairoathenadugay
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxchadhar227
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 

Kürzlich hochgeladen (20)

Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 

Sql Saturday #638 - Dashboard Development in R

  • 2. @rickwargo • Works at InfoMC, Inc. Director, Architecture and Development • You’ll see me • At the beach • Behind the camera • Cooking • Developing • Exploring • Frolicking with my family • Published R package – lrequire (makes dashboard development easier) • One of the original ten Alexa Champions • Presentation available at https://www.rickwargo.com/dashboard-development-in-r/
  • 4. Why R? • Data Acquisition is Easy • CSV, XML, DB, REST, … • Libraries-a-Plenty • Graphing, Analytics, Machine Learning, Dashboarding, … • Established Practices for • Getting and Cleansing Data (“tidy”) • Reproducibility • Peer Review
  • 6. Let’s Use Apple Health Data - Steps Data Acquisition from Analytics Playbook Export Health Data from iPhone 1 3 2
  • 7. Get Data Presentation Ready • Acquire data • Clean and Tidy • Tidy: Get the data in a format that is easy to manipulate, model, and visualize • observations are in rows • variables are in columns • contained in a single dataset • Augment
  • 8. apple_health_data.R library(lubridate) library(XML) # load apple health export.xml file xml <- xmlParse("~/Code/R/AppleHealthData/apple_health_export/export.xml") # transform xml file to data frame - select the Record rows from the xml file steps.df <- XML:::xmlAttrsToDataFrame(xml['//Record[@type="HKQuantityTypeIdentifierStepCount"]'], stringsAsFactors = FALSE) # make value variable numeric steps.df$value <- as.numeric(steps.df$value) # make endDate in a date time variable POSIXct using lubridate with eastern time zone steps.df$endDate <- ymd_hms(steps.df$endDate, tz="America/New_York") # augment data - add in year month date dayofweek hour period columns steps.df$month <- format(steps.df$endDate,"%m") steps.df$year <- format(steps.df$endDate,"%Y") steps.df$date <- format(steps.df$endDate,"%Y-%m-%d") steps.df$dayofweek <- wday(steps.df$endDate, label=TRUE, abbr=FALSE) steps.df$hour <- format(steps.df$endDate,"%H") steps.df$period <- format(steps.df$endDate, "%Y-%m") steps.df <- steps.df[steps.df$period>"2016-09",] module.exports <- list(steps=steps.df, summary=summary.df)
  • 9. Consume the Data library(lrequire) df <- lrequire(apple_health_data) or df <- lrequire(apple_health_data, force.reload = TRUE) Let’s see this in R!
  • 11.
  • 12. Dashboard Tools in R Shiny • Host on your own servers or on Rstudio’s hosting service • No web development skills required, but you can if you desire • shinydashboard -- install.packages("shinydashboard") • shinythemes -- install.packages("shinythemes") • Extensible flexdashboard for R • Uses R Markdown for publication (knitr is another great option) plotly Dashboards ($$) • Beautiful, publication-quality graphics • API’s for multiple languages including R, Python, Matlab, …
  • 13. Create a Shiny Dashboard • From R Studio, create a Shiny Web App • Run app locally (to test) • Publish to share with small team – other hosting options available
  • 14. Examples • Streaming CRAN data • Twin Cities Buses
  • 15. My Apple Health Data Shiny Dashboard
  • 17. Send an email via R Markdown/knitr
  • 19. Serve a Dashboard in Slack
  • 20. More Learning Coursera – Data Science Specialization R Libraries • lrequire: Sources an R "Module" with Caching & Encapsulation, Returning Exported Vars

Hinweis der Redaktion

  1. Often the first choice for statistics, data analysis, and machine learning, R has a variety of use cases that make it a great fit. And due to the open-source nature of R, there are many packages that make R a great tool for developing dashboards. In this session, we will discover and understand how to build dashboards in R using a few different patterns. We will also understand how to deliver this content to the consumer in multiple forms, including on-demand (web and bot), interactive (web), and batch (email). You will leave this session with an understanding of how to start developing dashboards in R and how to deliver them to your user community. To get the most from this session, some general knowledge of R and programming languages is required.
  2. Why Dashboards? You wouldn’t be here if you could not answer this part of the question. We will not cover how to build a good dashboard – this is an entire presentation in itself. We also will not cover selecting the right KPI’s or dashboard representations
  3. For an introduction to R and SQL Server, see Dan Hartshorn’s session immediately following in this room! Compare creating dashboards in Excel – semi easy to acquire and augment data. Cleansing is a bit more difficult. Delivery is challenged. Not a lot of reusable components. Excel is hard – a study in 2013 found 88% of spreadsheets had significant errors. And best of all, it’s cheap, if not free! Of course, if you want to pay for support and tools, R can do that, too!
  4. It’s all about the data and the data insights All dashboards are data-driven with regularly updated (and correct) data Ideally, in a real dashboard environment, this data refresh would be automated. We won’t cover all of the different ways of acquiring data. In this session, we’ll get data from an XML source (first time for me:)
  5. 80% of the effort of analysis is spent just getting the data ready to analyze, the process of data cleaning Getting data tidy: getting the data in a format that is easy to manipulate, model, and visualize R is an awesome tool to get this job done, and get it done consistently
  6. Not the perfect example of making a dataset tidy, however… Augments the data set with time data Makes it available for quick reuse I typically will spend a good amount of time acquiring and cleansing data and make available for reuse to a dashboarding routine
  7. To consume the data, use the nifty lrequire module to load the data (one time) and return. Future uses will pull from memory and be quick – the acquisition/cleansing process is typically time consuming This becomes integral for an iterative cycle around dashboard development Run through this in R
  8. All different types of dashboards can be made with R – with rich visualizations, static and dynamic content, and a variety of libraries to make it easier
  9. Shiny, by R Studio, the same folks who brought the defacto R IDE These are some of the major players when it comes to dashboard tools. There are many more and most of these are free!
  10. Do the Create a New Shiny Web App, show it and publish it to show hosted solution. Not what I would call a dashboard, “yet” but can be turned into one.
  11. Do the Create a New Shiny Web App, show it and publish it to show hosted solution. Not what I would call a dashboard, “yet” but can be turned into one.
  12. Do the Create a New Shiny Web App, show it and publish it to show hosted solution. Not what I would call a dashboard, “yet” but can be turned into one.
  13. Written with R Markdown so that it is easy to format. Output to HTML or PDF Send in an email Demo flex.Rmd Demo email.R
  14. Written with R Markdown so that it is easy to format. Output to HTML or PDF Send in an email Demo flex.Rmd Demo email.R
  15. Beautiful graphics Support in different languages (R, Python, build one online) $$$
  16. Very cool self-service dashboarding/reporting!
  17. Coursera course started May 29, 2017 – lots of opportunities to sign up