Skip to content

Commit

Permalink
added some necessary assumptions to the modal window of the formual e…
Browse files Browse the repository at this point in the history
…ditor in order to control it via shinytest2
  • Loading branch information
Konrad1991 committed Nov 18, 2024
1 parent a78557e commit c222c64
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 15 additions & 1 deletion bs/R/assumption.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ assServer <- function(id, data, listResults) {
FormulaEditorUI("FO"),
easyClose = TRUE,
size = "l",
footer = NULL
footer = tagList(
modalButton("Close")
)
))
})

Expand Down Expand Up @@ -177,6 +179,9 @@ assServer <- function(id, data, listResults) {
res <- do.call(rbind, res)
})
if (!inherits(e, "try-error")) {
exportTestValues(
assumption_res = res
)
listResults$curr_data <- res
listResults$curr_name <- paste("Test Nr", length(listResults$all_names) + 1, "Conducted shapiro test")
output$curr_result <- renderTable(res, digits = 6)
Expand Down Expand Up @@ -206,6 +211,9 @@ assServer <- function(id, data, listResults) {
res$`Residuals normal distributed` <- res$p.value > 0.05
})
if (!inherits(e, "try-error")) {
exportTestValues(
assumption_res = res
)
listResults$curr_data <- res
listResults$curr_name <- paste("Test Nr", length(listResults$all_names) + 1, "Conducted shapiro test")
output$curr_result <- renderTable(res, digits = 6)
Expand Down Expand Up @@ -235,6 +243,9 @@ assServer <- function(id, data, listResults) {
err <- conditionMessage(attr(e, "condition"))
output$ass_error <- renderText(err)
} else {
exportTestValues(
assumption_res = fit
)
listResults$curr_data <- fit
listResults$curr_name <- paste("Test Nr", length(listResults$all_names) + 1, "variance homogenity (levene)")
output$curr_result <- renderTable(fit, digits = 6)
Expand Down Expand Up @@ -270,6 +281,9 @@ assServer <- function(id, data, listResults) {
err <- conditionMessage(attr(e, "condition"))
output$ass_error <- renderText(err)
} else {
exportTestValues(
assumption_res = p
)
listResults$curr_data <- new("plot", p = p, width = 15, height = 15, resolution = 600)
listResults$curr_name <- paste("Plot Nr", length(listResults$all_names) + 1, "diagnostic plots")
output$DiagnosticPlotRes <- renderPlot(p)
Expand Down
7 changes: 6 additions & 1 deletion bs/R/correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ corrServer <- function(id, data, listResults) {
FormulaEditorUI("FO"),
easyClose = TRUE,
size = "l",
footer = NULL
footer = tagList(
modalButton("Close")
)
))
})

Expand Down Expand Up @@ -159,6 +161,9 @@ corrServer <- function(id, data, listResults) {
invokeRestart("muffleWarning")
}
)
exportTestValues(
correlation_res = fit
)
listResults$curr_data <- fit
listResults$curr_name <- paste("Test Nr", length(listResults$all_names) + 1, "Conducted test: ", method)
output$corr_result <- renderTable(fit, digits = 6)
Expand Down

0 comments on commit c222c64

Please sign in to comment.