Skip to content

Commit

Permalink
added statistical tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Mar 21, 2024
1 parent 93b3c89 commit ffb9411
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions BiostatsGithubPage/statisticalTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ testsUI <- function(id) {
tabsetPanel(
tabPanel("Two groups",
br(),
actionButton(NS(id, "CreatePlotBox"), "Create plot")
),
tabPanel("More than two groups",
br(),
actionButton(NS(id, "CreatePlotScatter"), "Create plot")
),
tabPanel("Posthoc tests",
br(),
actionButton(NS(id, "CreatePlotLine"), "Create plot")
),
id = "TestsConditionedPanels"
),
Expand Down Expand Up @@ -138,6 +135,7 @@ testsServer <- function(id, data, listResults) {
})

conductTests <- function(method) {
output$test_error <- renderText(NULL)
req(is.data.frame(data$df))
df <- data$df
req(input$indep)
Expand Down Expand Up @@ -203,7 +201,11 @@ testsServer <- function(id, data, listResults) {
if (inherits(e, "try-error")) {
err <- conditionMessage(attr(e, "condition"))
output$test_error <- renderText(err)
} else if(is.null(fit)) {
output$test_error <- renderText("Result is NULL")
} else {
fit <- cbind(fit, row.names(fit))
names(fit)[ncol(fit)] <- paste0(indep, collapse = ".")
listResults$curr_data <- fit
listResults$curr_name <- paste("Test Nr", length(listResults$all_names) + 1, "Conducted: ", method)
output$test_result <- renderTable(fit, digits = 6)
Expand Down
Loading

0 comments on commit ffb9411

Please sign in to comment.