4 Tips: from Excel tool to Shiny

4.2 Read Variables from csv file

When you have many user-provided input variables and many outputs that are returned to the user, it is convenient to automate the definition of input and output through a loop.

For example, consider a table of variable name, label, indicator for a user-provided input, default value etc.

This kind of table can be converted into UI objects in a loop. For example, each row can be processed by lapply() function;

4.3 Multiple Scenarios in Columns

Excel-based decision-making tools are often designed to contain variables in rows and varying scenarios in columns via CSS.

An example is shown in input_columns.R and main.css in custom_css_example folder.

Here is a screen shot;

4.4 Generating a Report

Using Rmarkdown and knitr, it is easy to add a report function containing texts and objects from a shiny app.

Live app is here

Here is a screen shot;

4.7 Google Analytics

It is easy to add a usage tracking system via Google Analytics.

RStuido’s instructions: here and here.

To get started, here are the two steps;

source

An example is provided in minimum_example1.R file.

Note: when specifying your URL in Google Analytics, be sure to choose correctly “http” or “https”.

Tracking changes in input variables is also possible. See JavaScriptEvent in Shiny.

googleAnalyticsR provide a variety of tools to make use of Google Analytics data.

4.8 Custom Layout, Colors, and HTML modifications

To an extent, one can choose from various layouts, themes, and color palette options to customize the visual effects of a shiny application and make the application more accessible from mobile phones etc. While customization is beyond the scope of this tutorial, here are the basics;

Here is a screen shot;

For more advanced customization, feel free to contact us. Our programmer may have a quick tip or may be hired for a short-term contract.