Hi Everyone! Need a favour
I have coded the ui.R page with the following
library(shiny)
install.packages("shiny")
library(shiny)
library(shinythemes)
library(shinydashboard)
library(ggplot2)
library(mlutils)
install.packages("mlutils")
install.packages("shinythemes")
install.packages("shinydashboard")
install.packages("shinyWidgets")
library(shinyWidgets)
ui <- fluidPage(
sliderInput(inputId = "num",
label = "Age in month",
value = 25, min = 1, max = 1500),
numericInput(inputId = "sys",
label = "Height in cm",
value = 160, min = 1, max = 240),
numericInput(inputId = "dia",
label = "Weight in Kg",
value = 90, min = 1, max = 300),
selectInput("Gender", "Gender", c("Man", "Woman")),
numericInput(inputId = "num",
label = "Systolic blood pressure",
value = 90, min = 1, max = 300),
numericInput(inputId = "num",
label = "Diastolic blood pressure",
value = 90, min = 1, max = 300),
selectInput("Cholesterol", "Cholesterol", c("Normal", "Above Normal", "Much above Normal")),
selectInput("Glucose", "Glucose", c("Normal", "Above Normal", "Much above Normal")),
radioGroupButtons("Alcohol consumption", "Alcohol consumption", c("Yes", "Not at all")),
radioGroupButtons("Lifestyle", "Lifestyle", c("Active", "Not Active")),
tags$h2("Risk of Cardiovascular Disease"),
setBackgroundImage(
src = "https://cdn.pixabay.com/photo/2018/06/27/08/12/heart-3501018_1280.jpg"),
textOutput("selected_var")
)
server <- function(input, output) {}
shinyApp(server = server, ui = ui)
I need to build the output, into a regression equation, and compute the final result as y=mx1+ nx2+ox3.... How do I input the categorical variables like Gender, "Male" which was assigned a dummy variable "1", say!
Can anyone please guide me on how to build the server.R codes