# Load packages ----------------------------------------------------------------
library(shiny)
library(shinythemes)
# Define UI --------------------------------------------------------------------
ui <- fluidPage(theme = shinytheme("cerulean"),
# App title ----
titlePanel(HTML("Rockport Walk Test VO2 max calculator")),
# Navbar Panel with two tabs
navbarPage(
title = "Rockport Walk Test VO2 max calculator",
tabPanel("Home",
# Sidebar layout with a input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
h3(HTML("VO2 max Calculator")),
hr(),
p(HTML("For an estimate of your VO2 max, enter your gender, age, weight, and heart rate at the end of the test, the time to complete the walk and then select the 'Calculate' button.")),
h5("Inputs"),
# Input: Gender ----
numericInput(inputId = "gender",
label = "Gender (1 = male, 0 = female)",
value = 0
),
# Input: Age ----
numericInput(inputId = "age",
label = "Age (years)",
value = 0
),
# Input: Heart rate ----
numericInput(inputId = "heart_rate",
label = "Heart rate (bpm)",
value = 0
),
# Input: Weight ----
numericInput(inputId = "weight",
label = "Weight (lbs)",
value = 0
),
# Input: Time ----
numericInput(inputId = "time",
label = "Time (minutes and 100ths of minutes)",
value = 0
),
# Action button ----
actionButton(inputId = "calculate",
label = "Calculate"
)
),
# Main panel for displaying outputs ----
mainPanel(
h3("Output"),
# Output: VO2 max ----
textOutput(outputId = "vo2max"),
# Output: Hyperlink to VO2 max page ----
uiOutput(outputId = "vo2max_page"),
# Output: Reference section ----
hr(),
textOutput(outputId = "vo2max_references")
)
)
),
tabPanel("About",
p(HTML("The Rockport Walk Test is a common aerobic fitness test for those of low fitness level. The aim if the test is to walk as fast as possible for 1 mile.
To conduct this test, you will require: