Skip to content

Commit

Permalink
preparing arithmetic mean
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelso committed Nov 14, 2024
1 parent cc1dca8 commit 3ffc063
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions R/mod_tool_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ mod_tool_server <- function(id, rv) {

## + Events ================================================================

## Read the XLSX files
## ++ Check uploaded file columns ------------------------------------------
observeEvent(input$load_xlsx, {

rv$inputs$xlsx_path <- input$load_xlsx$datapath

# rv$inputs$xlsx_tabs <- readxl::excel_sheets(input$load_xlsx$datapath)
# rv$inputs$xlsx_tabs_ok <- all(rv$checklist$xlsx_tabs %in% rv$inputs$xlsx_tabs)
rv$inputs$xlsx_tabs_ok <- all(rv$checklist$xlsx_tabs %in% readxl::excel_sheets(input$load_xlsx$datapath))

if(rv$inputs$xlsx_tabs_ok) {
Expand All @@ -36,17 +33,6 @@ mod_tool_server <- function(id, rv) {

})

# observe({
# req(input$load_xlsx$datapath)
#
# rv$inputs$xlsx_path <- input$load_xlsx$datapath
#
# # rv$inputs$xlsx_tabs <- readxl::excel_sheets(input$load_xlsx$datapath)
# # rv$inputs$xlsx_tabs_ok <- all(rv$checklist$xlsx_tabs %in% rv$inputs$xlsx_tabs)
# rv$inputs$xlsx_tabs_ok <- all(rv$checklist$xlsx_tabs %in% readxl::excel_sheets(input$load_xlsx$datapath))
#
# })

## + Outputs ===============================================================

## Download example 1 if needed
Expand All @@ -59,26 +45,6 @@ mod_tool_server <- function(id, rv) {
rv$inputs$xlsx_tabs_ok
})

## + UI changes ============================================================

## Show hide data ok if tabs are correct

# observe({
# req(rv$inputs$xlsx_tabs_ok)
#
# if(rv$inputs$xlsx_tabs_ok) {
# shinyjs::hide("msg_no_data")
# shinyjs::show("msg_data_tabs_ok")
# shinyjs::hide("msg_data_tabs_wrong")
# shinyjs::enable("btn_run_checks")
# } else {
# shinyjs::hide("msg_no_data")
# shinyjs::hide("msg_data_tabs_ok")
# shinyjs::show("msg_data_tabs_wrong")
# shinyjs::disable("btn_run_checks")
# }
#
# })

##
## 2. Read data and run checks #############################################
Expand Down Expand Up @@ -133,9 +99,7 @@ mod_tool_server <- function(id, rv) {
)

## ++ Calculations -------------------------------------------------------
Sys.sleep(0.1)

rv$checks$arithm <- fct_combine_mcs_C()
Sys.sleep(0.5)

shinyWidgets::updateProgressBar(
title = "Calculations done...",
Expand Down

0 comments on commit 3ffc063

Please sign in to comment.