Sandeep Dutta
November 5, 2016
This is a simple temperature conversion application developed as a Shiny App. The user can provide an input temperature they want to convert and also what is the type of conversion they need to do. The results are interactively displayed both as text as well as in a graph as soon as the user makes his selection.
The Shiny UI lets the user select the input parameter and conversion type. The Server uses those values to do the conversion and generate a bar chart of the values.
The Celsius to Fahrenheit conversion is done as follows:
temp_inC <- 0
temp_inF <- (9.0/5.0)*(temp_inC) + 32
c(temp_inC, temp_inF)
[1] 0 32
The Fahrenheit to Celsius conversion is done as follows:
temp_inF <- 100
temp_inC <- (5.0/9.0)*(temp_inF - 32)
c(temp_inF, temp_inC)
[1] 100.00000 37.77778
The selection of the radiobutton lets the application know whether the User intends to do a Celsius to Fahrenheit conversion or vice-versa. Depending on that selection, the application knows what is the unit of the input temperature and what should be the unit of the output temperature.
The slider input allows the user to select any value between -150 and 150 and then request the converted temperature in Celsius or Fahrenheit.
The application can be accessed at: https://sdutt00.shinyapps.io/Simple_Temperature_Conversion/
The code for the application can be accessed at: https://github.com/sdutt00/ShinyTemperatureConverter