Skip to content

Commit

Permalink
Add action button for outliers detection
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Apr 9, 2024
1 parent 5daa129 commit 2b57086
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions R/module_coda_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coda_outliers_ui <- function(id) {
min = 0.025, max = 0.995,
value = 0.975, step = 0.005
),
actionButton(inputId = ns("go"), label = "(Re)Detect"),
downloadButton(outputId = ns("download"), "Download results")
), # sidebarPanel
mainPanel(
Expand Down Expand Up @@ -71,22 +72,25 @@ coda_outliers_server <- function(id, x) {

moduleServer(id, function(input, output, session) {
## Detect outliers -----
out <- reactive({
req(x())
out <- bindEvent(
reactive({
validate(need(x(), "Check your data."))

run_with_notification(
{
nexus::outliers(
x(),
groups = nexus::get_groups(x()),
robust = input$robust,
method = c("mve", "mcd"),
quantile = input$quantile
)
},
what = "Outliers detection"
)
})
run_with_notification(
{
nexus::outliers(
x(),
groups = nexus::get_groups(x()),
robust = input$robust,
method = c("mve", "mcd"),
quantile = input$quantile
)
},
what = "Outliers detection"
)
}),
input$go
)

## Select group -----
bindEvent(
Expand Down

0 comments on commit 2b57086

Please sign in to comment.