shiny

 

 

 

 

 

 

 

 

 

 

What is R and what is Shiny?

R is free, open-source, powerful and highly extensible programming language especially useful for statistical analysis and data shenanigans. Google’s chief economist back at 2009 said and I quote, “You have a lot of prepackaged stuff that’s already available, so you’re standing on the shoulders of giants” when talking about R. And what is Shiny and where does it fit in the R jigsaw?

Shiny is a web framework for R developers. Shiny allows users to develop websites that help present their analyses to users by allowing the analyses to be interactive through a web-based interfaces. Shiny web-interfaces are programmed in R without the need to develop anything in HTML, CSS, or Javascript, but having said that Shiny is flexible enough to incorporate custom HTML, CSS, or Javascript if the user desires (to develop customized visualizations for instance).

Why R and Shiny?

When people ask “Can you use R to…“, R evangelist especially data analyst and a prodigy of R would probably politely interrupt and reply with , “Yes, you can! R probably already has a package for this”. So, why use R? The answer is for easier statistical computing, data analytics, predictive analytics and data mining. Can’t we do this with other language? Yes, sure why not? But, watch out for all the arduous path for statistical calculations one has to go through where there is probably one liner for what you will spend or have already spent hours developing in other programming languages. Okay, I get it, but what’s the use case for a company that has little to no work on data analytics.

Okay, the above statement is totally wrong, there is a prospect of data manipulation at every organization. What is the best turnover ever? Why was there a dry spell? How can we be aware of unforeseeable  losses? If there’s some failure when is the best time for replacement? Where is the trend setting up and how can we be aware of falling behind on technologies? these are the questions that can be answered with analytics in R. R can be tailored to the specific requirements of the condition monitoring and diagnostic technologies an organization might need. You will get all the statistical tools at your disposal such as Clustering, Classification, Regression Analysis or Event History Analysis. Again, now why Shiny?

Shiny fits the picture when one can monitor and analyze the system through a web app. Shiny has commercial and enterprise versions where the commercial one is free. One can deploy the server and explore the possibilities.

Limitations and possible workarounds!

Spoiler alert: Shiny apps don’t look pretty. but, there are packages available to make it more wow.., one of those is shiny.semantic. Likewise, the shiny web apps are best suited for monitoring purpose that limit to few people. Why?? Because, R is a single threaded application.SO, if a user wants to see the 200 years of soccer history and there is another user who is running the same query then watch out one  can get the result in 10 seconds and the unlucky one should settle for 40 seconds. So, what now? How about spawning multiple threads and pre-analyzing to redirect to less busy server.

Likewise, in app navigation and state keeping aren’t bundled in shiny but one can find a workaround using the package called shiny.router and make it a more modern web app.

Conclusion

Shiny web app basically for internal use case is awesome if used as monitoring tool, predictive analysis tool (for instance for Business Analyst) and cutting out the pain to deal with statistical computation is where R and shiny come handy.

Leave a Reply

Your email address will not be published. Required fields are marked *