Skip to content
Snippets Groups Projects
Commit f70faf46 authored by Wu, Harold's avatar Wu, Harold
Browse files

Update app.R

parent a544098c
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ ui <- fluidPage(useShinyjs(),
tags$p("Enter the value of your observed proportion in the text
under the graph. Selecting 'greater/less than' will highlight the
samples that are greater/less than your value."),
tags$p("Selecting 'beyond' will highlight the samples that are further away
tags$p("Selecting 'further from center' will highlight the samples that are further away
from the 'Probability of Success' than your value."),
tags$p("Press the Reset button whenever you change the Probability of Success
or the Sample Size."),
......@@ -97,7 +97,7 @@ ui <- fluidPage(useShinyjs(),
textOutput("summary"),
fluidRow(
column(textOutput("count.samples"), width = 3),
column(selectInput("inequality", NULL, c("greater than", "less than", "beyond")), width = 3),
column(selectInput("inequality", NULL, c("greater than", "less than", "further from center")), width = 3),
column(textInput("cutoff", NULL), width = 4),
textOutput("counts"))
)
......@@ -183,7 +183,7 @@ server <- function(input, output, session) {
# for "greater than", finds the number and proportion of values greater than
# input$cutoff - error. For "less than", finds the number and proportion of
# values less than input$cutoff + error. For "beyond", finds the number and
# values less than input$cutoff + error. For "further from center", finds the number and
# proportion of values less than (mean - diff) + error and values greater than
# (mean + diff) - error, where diff is |input$cutoff - mean|
if (input$inequality == "greater than"){
......@@ -308,9 +308,11 @@ server <- function(input, output, session) {
if (is.na(values$prob)){
" "
} else if (!is.na(as.numeric(input$cutoff))){
paste(values$count, "/", length(values$props), " (", round(values$prob, 4), ")", sep = "")
paste("<font color=", cutoff.color, "><b>",values$count, "/",
length(values$props), " (", round(values$prob, 4), ")",
"</b></font>", sep = "")
} else if (nchar(input$cutoff)!=0){
"Invalid Cutoff!"
"<font color=\"#FF0000\"><b>Invalid Cutoff!</b></font>"
} else {
" "
}
......@@ -327,5 +329,4 @@ server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server, options = list(height = 1080))
shinyApp(ui = ui, server = server, options = list(height = 1080))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment