From a8b8328caf0d5a742d53d201e54d66aeda8a8c01 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Wed, 25 Sep 2024 09:59:57 +0200 Subject: [PATCH] Improved input validation on numerics (#4) --- app.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app.R b/app.R index 1b2effe..32d3add 100644 --- a/app.R +++ b/app.R @@ -21,8 +21,14 @@ ui <- fluidPage( wellPanel( h2("Select covariates"), radioButtons("sex", "Sex", c("Male", "Female")), - numericInput("height", "Height (cm)", value = 0, min = 0), - numericInput("bmi", "BMI", value = 0, min = 0) + numericInput( + "height", "Height (cm)", + value = 100L, min = 0L, step = 1L, max = 200L + ), + numericInput( + "bmi", "BMI", + value = 20, min = 0, max = 50, step = 0.1 + ) ), actionButton("submit", "Calculate endpoints") ),