Ankit Jain
December 13, 2014
shinyUI(pageWithSidebar(
headerPanel("Data on the relation between temperature in degrees Celsius and vapor pressure of mercury in millimeters (of mercury)."),
sidebarPanel(
sliderInput('temp', 'Temperature Celsius between ', 260, min = 0, max = 360, step = 20), submitButton('Submit')),
mainPanel(
h3('Results of prediction'),
h4('You entered Temperature in Celsius '),
verbatimTextOutput("inputValue"),
h4('Temp in Kelvin '),
verbatimTextOutput("prediction"),
h4('Pressure'),
verbatimTextOutput("pressure"))))
Tempera <- function(temp) 9*temp/5+32
Pres <- function(temp) {subset(pressure,temperature == temp,select=c(pressure))}
shinyServer(
function(input, output) {
output$inputValue <- renderPrint({input$temp})
output$prediction <- renderPrint({Tempera(input$temp)})
output$pressure <- renderPrint({Pres(input$temp)})})
On choosing temperature in celsius via slider and clicking on submit button, one can get the temperature in celius converted to kelvin.
Also, based on the Data on the relation between temperature in degrees Celsius and vapor pressure of mercury in millimeters (of mercury), one can get the pressure