SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

Similar a 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
 

Similar a 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...
 

Último

Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 

Último (20)

Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 

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

Notas del editor

  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