-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
41 lines (33 loc) · 1.03 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define UI for application that calculates your Body Mass Index(BMI)
shinyUI(
pageWithSidebar(
# Application title
headerPanel("BMI Caculator"),
# Sidebar with the height and weight text input
sidebarPanel(
numericInput('height', 'Height (m)', 1.65, min = 0, max = 3, step = 0.01),
numericInput('weight', 'Weight (kg)', 55, min = 0, max = 300, step = 0.5),
submitButton('Submit')
),
# Show the result of BMI
mainPanel(
h3('Your BMI'),
verbatimTextOutput("result"),
h3('Your BMI Status'),
verbatimTextOutput('status'),
h3('BMI reference value'),
h4('<18.5 | Underweight'),
h4('18.5~24.9 | Normal'),
h4('>=25.0 | Overweight')
)
)
)