Building data products is no easy feat. At TCB Analytics, we always start with the question(s) we want to answer and then immediately identify relevant data sets. At what point though, does it make sense to build something? We discuss various examples of client work in which we used Shiny to rapidly protoype, pull data from APIs, leverage Google Vision's image recognition service and more.
6. SUPPORT DECISION MAKING
Get used to asking yourself: “So what?”
Provides actionable insights – DO SOMETHING
Ability to ask “What-If?” questions
8. WHY NOT JUST USE TABLEAU?
Source: http://nandeshwar.info/data-science-2/tableau-vs-r/
Depends on…
• Use Case
• Audience
• In-house skills
• Great for aggregations and summary
dashboards with drill-downs and filters
16. GOOGLE VISION API
Powerful image analysis that enables:
• Logo detection
• Landmark detection
• Optical Character Recognition
• Face and emotion detection
• Classification of objects from trains to animals
17. GOOGLE VISION API
Scraped 5,000+ images
from the New England
Patriots Facebook page
Classified all pictures to
understand brand /
sponsor presence on
Patriots page
19. FANTASY OPTIMIZERS
http://apps.fantasyfootballanalytics.net/
https://tcb-analytics.shinyapps.io/dfsnba/
Additional Reading on scaling: https://www.slideshare.net/appsilon/scaling-shiny-apps-earl-2017-san-francisco
2013 - Started with Shiny Server – ran into
scaling issues
2015 - Moved to OpenCPU/Azure – ran into
scaling issues in OpenCPU (greater
capacity servers may have resolved, but
$$$). Azure also required Java.
2017 - Moved back to Shiny (shinyapps.io
w/ professional plan) – so far no scaling
issues
20. WHEN TO USE SHINY SERVER PRO
20
https://support.rstudio.com/hc/en-us/articles/218294997-What-is-the-difference-between-shinyapps-io-and-Shiny-Server-Pro-
Outside firewall? Data in cloud? Users must register? Shared Resources?
If your organization is not OK with any of the above… you may want to consider Shiny Server Pro
21. PRODUCTION PITFALLS
Too good, too fast
Inability to keep up with demands
and scale
Best to implement unit tests,
documentation, deployment best
practices in advance or at least
be prepared to do so quickly
http://schd.ws/hosted_files/user2017/7d/UseR2017_ShinyPrototypesOutOfControl.pdf
Building the plane while flying
Treat your R script like a program. Knitr is an R package that facilitates the embedding of R code into documents, written either in RMarkdown or LaTeX which can then be processed into many output formats (Markdown, HTML, PDF).Docker is a relatively new tool for building portable computing environments known as containers. Docker containers provide an isolated environment that acts like a separate computer. Continuous integration (CI) is an approach to software engineering that emphasizes testing your code after every meaningful change to the code base.
FFA – add Isaac’s story
In 2013, we initially started with Shiny Server, but ran into scaling issues, so in 2015 we moved to OpenCPU/Azure. We continued to run into scaling issues in OpenCPU (that might have been fixable with greater capacity servers that were out of our price range). It didn't help that we needed Java programmers (in addition to R programmers) to publish our apps on Azure. So, this season, we've come full circle and came back to Shiny (specifically shinyapps.io). So far, we haven't run into scaling issues, which has been very refreshing. We are using the Professional Plan. However, I'm not sure what our peak allowable load is at this point.
Shiny Server Pro might also be a good option, but it was outside of our financial means. You might see this company's info on building a scalable Shiny app in Shiny Server Pro: http://appsilondatascience.com/blog/rstats/2017/10/17/scaling-shiny.html.
Are you okay with your application being outside your firewall?
Are you okay with the data that the application is pulling from being accessible to our cloud?(You have to open up a hole in your firewall if the data is behind the firewall today.)
Are you okay with your end client creating a user account on shinyapps.io (if you are looking to use authentication).
Are you okay with a shared computation platform for your analyses? (for example, we don’t have any SLAs today on performance)
If the answer is no to any of these questions, you may want to go with Shiny Server Pro.