Dilmi Jayasena
January 29, 2019
Complex UI Hacks for RShiny
At Linear Squared, we build interactive applications to communicate findings and monitor business KPIs via complex algorithms. When designing new product enhancements there’s often a sudden need to demonstrate the functionality of these new components. For this purpose, to prototype, Linear Squared uses R shiny as it can be used to build interactive applications easily.
There are many free resources to learn R Shiny on your own such as the following:
https://shiny.rstudio.com/articles/basics.html
https://shiny.rstudio.com/tutorial/
When prototyping RShiny solutions, I came across a few challenges for which there were little to no good resources with guidance – especially for newer versions of RShiny. The goal of this blog post is to help RShiny users in tackling 3 of these problems, which I believe are common. At the end of this blog post, you will have the answers for the following:
1.How to create an editable table where the changes are reflected in the plot
2.How to call a python script from R shiny
3.How to give an indication when R shiny is processing
In order to cover all of the mentioned above, I’m going to build a small example app.
Sales demand forecasting is a common task in the industry. Organizations often do resource planning using sales forecasts as inputs. Hence, I thought of using this scenario to create our example app. The app will compute sales forecast and then the sales forecast will be used as an input to an KPI optimizer algorithm written in Python, which will give you an optimizer output table based on the given demand. You can input your favorite forecasting algorithm and optimization problem and solution where appropriate.
Now let’s get started!

Dhrmapala Mawatha,
Colombo-07,
Sri Lanka.
#27-00,
Republic Plaza,
Singapore, 048619.
Jl. Raden Saleh Raya,
No. 46A, Jakarta,
Indonesia.