Home > other >  How to use shiny app] [beginner questions R language input several value calculate a new value and d
How to use shiny app] [beginner questions R language input several value calculate a new value and d

Time:09-26

The following is my half complete code
The library (shiny)
# Define the UI for the dataset viewer app -
The UI & lt; - fluidPage (
# App title -
TitlePanel (" Medical Diagnosis),
SidebarLayout (
SidebarPanel (
NumericInput (inputId="sensitivity",
Label="Number of Sensitivity to the view:",
Value=https://bbs.csdn.net/topics/0.9, min=0, Max=1),
NumericInput (inputId="specificity",
Label="Number of Specificity to the view:",
Value=https://bbs.csdn.net/topics/0.8, min=0, Max=1),
NumericInput (inputId="prevalence",
Label="Number of Prevalence to view:",
Value=https://bbs.csdn.net/topics/0.7, min=0, Max=1),
NumericInput (inputId="times",
Label="Number of Inspections to the view:",
Value=https://bbs.csdn.net/topics/1, min=1),
SubmitButton (" Update View "),
),
MainPanel (
# the Output: Formatted text for caption -
TableOutput (" values ")
)
))
Server & lt; - the function (input, output) {
NumericValues & lt; - reactive ({
The data frame (
Name=c (" Sensitivity ",
"Specifity,"
"Prevalence",
"The Number of Inspections,"
"Positive predicted value",
"False discovery rate"),
Value=https://bbs.csdn.net/topics/as.character (c (input $sensitivity,
Input $specificity,
Input $prevalence,
Input $times,
Input $PPV,
Input $FBR
)),
StringsAsFactors=FALSE)

})
The output $values & lt; - renderTable ({
NumericValues ()
})

}
ShinyApp (UI, server)

PPV and FBR are input above three values calculated, the following is the formula for calculating
Ppv<- * prevalence (sensitivity)/(prevalence * sensitivity + (1 - specificity) * (1 -) prevalence),
Fdr<- (1 - sensitivity) * prevalence/((1 - sensitivity) + (1 - prevalence) * * prevalence specificity),
No matter I plugged into it is wrong, prompt can not find object sensitivity,
Consult everybody greatly help me correct! Thank you very much!

CodePudding user response:

Quite urgent bosses help ah
  • Related