Mahmoud Shaaban
28 May 2016
(Wikipedia)
Inpute, by the user:
Then place the resulting value on the curve
library(shiny)
shinyUI(
pageWithSidebar(
headerPanel("Body-Mass Index (BMI)"),
sidebarPanel(
numericInput('height', 'Your Height (m)', 1.7),
numericInput('weight', 'Your Weight (kg)', 70),
submitButton('Submit')
),
mainPanel(
h3('Your BMI'),
verbatimTextOutput("prediction")
)
)
)
library(shiny)
bmi <- function(h, w) w / (h^2)
shinyServer(
function(input, output) {
output$prediction <- renderPrint({bmi(input$height, input$weight)})
}
)