In my previous blog I discussed the versatility of R Shiny, a popular package within R for developing interactive web apps. Although most people associate R Shiny with creating advanced dashboards, many more applications are possible. For example, using R Shiny to build input tools. In this blog I discuss a new R package I wrote called 'dlinputtool' and how it helps us create input tools with R Shiny. By Aniek, data scientist at Datalab
As a data scientist at Datalab, I am always looking for ways to find more efficient and effective solutions for data collection, analysis and visualisation. After using R Shiny to create various input tools, I came up with the idea of developing an R package to create input tools. This way I could reuse the code every time. The result: the 'dlinputtool package', which stands for Datalab Inputtool.
For the dlinputtool package I made use of modules. Within R Shiny there are various ways to structure and reuse code. One of those ways is modularisation - separating the functionalities of a web app into individual pieces of code that are therefore reusable. This means you can define different parts of a web app, such as the input fields and associated logic, separately and then reuse them in different web apps without having to write the same code again each time.
The 'dlinputtool package' that I wrote contains two modules: an inputUI and an inputServer.
- The inputUI module defines the user interface of the input tool, such as the input fields, buttons and styling.
- The inputServer module contains the logic and functionality for editing input and performing actions such as downloading, filtering, marking, saving and uploading data.
The advantages of using R Shiny and dlinputtool for creating input tools apply to both the dashboard maker and the client. Several advantages at a glance:
- More efficient development: Using dlinputtool as a reusable R package enables dashboard makers to develop input tools quickly and efficiently. The modules in dlinputtool can easily be adapted to the specific needs of the client.
- High-quality input tools: The dlinputtool package was developed with a focus on quality and functionality. By making use of the package's built-in functionality, dashboard makers can create high-quality input tools, resulting in reliable and professional input tools for the client.
- Cost savings: Using R Shiny and the dlinputtool package can result in cost savings for the client. Through more efficient development time, less code and more reusability, dashboard makers can deliver projects faster and more effectively, which can lead to lower development costs and a higher ROI for the client.
Conclusion: Using R Shiny in combination with the dlinputtool package is an efficient and professional way to develop high-quality input tools. And everyone wins from that.
