Interactional histogram on Rshiny and deploying app on website

There are many ways to create interactive visualizations, dashboards, and applications for business users who may not have the programming skills or interest to work in R. However, Shiny lets R developers generate interactive data visualizations for the web directly, with as much or as little GUI richness as they choose to invest. It dis-intermediates the relationship between data scientists and business users, resulting in high fidelity iterations and a timely, high-quality interactive data experience without (or with much less) web development and without the limitations or cost of proprietary BI tools. 

A Shiny application consists of two parts: ui and server. UI is where we can design user interface and server is where we assign tasks according to user choices. Let say we want to generate a histogram of Salary depending on selections of Job Role, Experience and Area. In the UI file, we will call three inputs, according to Job Role, Experience and Area. Input forms could vary from date range to check box or select button. In this case, we should choose dropbox selections, so that the options for each section will be automatically updated when the data changes. After that, we call the output name and place it at the main output panel.  

The most important thing that makes our histogram interact with any changes in the choices of users lies in the server file. We will filter data depending on users’ selection of each Job Role, Experience and Area; therefore, we will have three sub-datasets, the last of which will be used to plot histogram. For each time we filter the data, pass process through reactive{()} function, so that final data will then be iterated whenever JobRole, Experience or Area changes.  

After having the data and linking input in the UI file with data from the server, we will use the filtered data to generate a histogram. Since our histogram data is of continuous value (Pay), we have to set the number of bins. There will be problems if the data observes outliers. To aggregate all outliers to the first and last bin, we use the quartile threshold. Call the output name in the server file and draw histogram with ggplot inside renderPlot({}) expression, we have finished our server file. 

Here, we have completed the Shiny app that could run on a separate window and be ready to be used in a user-friendly interface. However, to deploy the app on an existing website, we have to host UI and server files on cloud with, then use < iframe> to embed the app to website code. 

Ha Nguyen

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on whatsapp
Share on email

Leave a Reply

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

Recent Post

Hadoop Vs. Hbase

Hadoop is an open-source framework of programs that is used to store and process big data. Hadoop uses multiple clusters of computers to analyze big data sets in parallel. The distributed processing of data sets can

Read More »
no sql databases

No SQL Databases : Types

No SQL databases are non-relational databases. It is an approach to database design which allows storage and retrieval of data in a non-tabular format as that found in relational database. NoSQL

Read More »

Contact us for a quote, help, or to join the team.



(732) 347-6245

About Us

iSmile Technologies is a global technology services company.
(732) 347-6245


+1 (732) 347-6245
241 Jonathan Way
Bolingbrook, IL 60490


2-3-285, Secunderabad Hyderabad 500003


3190 Stocksbridge Ave
Oakville, ON L6M 0A7