Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncaught error in tm_missing_data #578

Closed
chlebowa opened this issue Aug 17, 2023 · 8 comments
Closed

uncaught error in tm_missing_data #578

chlebowa opened this issue Aug 17, 2023 · 8 comments
Labels
bug Something isn't working core

Comments

@chlebowa
Copy link
Contributor

tm_missing_data

BEHAVIOR

Start example app, navigate to Grouped b y Subject tab, deselect Select variables.
An error appears in the console but not in the app (probably caught by validators as teal::validate_inputs message appears in output).

Warning: Error in if: argument is of length zero
  122: getDims
  121: catch
  120: value[[3L]]
  119: tryCatchOne
  118: tryCatchList
  117: tryCatch
  116: do
  115: hybrid_chain
  114: <reactive:plotObj>
   98: drawReactive
   85: renderFunc
   84: output$teal-main_ui-root-missing_data-module-ADRS-summary_plot-plot_main
    3: runApp
    2: print.shiny.appobj
    1: <Anonymous>

APP

rm(list = ls())
devtools::load_all()

library(nestcolor)

ADSL <- teal.modules.general::rADSL
ADRS <- teal.modules.general::rADRS

app <- teal::init(
  data = teal.data::cdisc_data(
    teal.data::cdisc_dataset("ADSL", ADSL, code = "ADSL <- teal.modules.general::rADSL"),
    teal.data::cdisc_dataset("ADRS", ADRS, code = "ADRS <- teal.modules.general::rADRS"),
    check = TRUE
  ),
  modules = teal::modules(
    teal.modules.general::tm_missing_data(
      ggplot2_args = list(
        "Combinations Hist" = teal.widgets::ggplot2_args(
          labs = list(subtitle = "Plot produced by Missing Data Module", caption = NULL)
        ),
        "Combinations Main" = teal.widgets::ggplot2_args(labs = list(title = NULL))
      )
    )
  )
)
shinyApp(app$ui, app$server, options = list(launch.browser = TRUE))
@chlebowa chlebowa added bug Something isn't working core labels Aug 17, 2023
@donyunardi
Copy link
Contributor

@chlebowa
I can't reproduce this error anymore in main branch. Perhaps this is addressed?

Updated example code:

data <- cdisc_data() |> within({
    ADSL <- teal.modules.general::rADSL
    ADRS <- teal.modules.general::rADRS 
  })

datanames(data) <- c("ADSL", "ADRS")

app <- init(
  data = data,
  modules = teal::modules(
    teal.modules.general::tm_missing_data(
      ggplot2_args = list(
        "Combinations Hist" = teal.widgets::ggplot2_args(
          labs = list(subtitle = "Plot produced by Missing Data Module", caption = NULL)
        ),
        "Combinations Main" = teal.widgets::ggplot2_args(labs = list(title = NULL))
      )
    )
  )
)
shinyApp(app$ui, app$server, options = list(launch.browser = TRUE))

@kartikeyakirar
Copy link
Contributor

I also confirmed that this issue is resolved and cannot be replicated on my end."

@chlebowa
Copy link
Contributor Author

Yup.

@vedhav
Copy link
Contributor

vedhav commented Oct 15, 2024

This seems to happen more frequently now. It is not consistent, but you can reproduce this by refreshing the app again and again until the error happens eventually.

App code to reproduce:

devtools::load_all()
library(nestcolor)



app <- teal::init(
  data = teal_data() |>
    within({
      ADSL <- teal.modules.general::rADSL
      ADRS <- teal.modules.general::rADRS
    }),
  modules = teal::modules(
    teal.modules.general::tm_missing_data(
      ggplot2_args = list(
        "Combinations Hist" = teal.widgets::ggplot2_args(
          labs = list(subtitle = "Plot produced by Missing Data Module", caption = NULL)
        ),
        "Combinations Main" = teal.widgets::ggplot2_args(labs = list(title = NULL))
      )
    )
  )
)
shinyApp(app$ui, app$server)

Error log in console:

Browsing http://127.0.0.1:4890
Warning: Error in if: argument is of length zero
  122: getDims
  121: catch
  120: value[[3L]]
  119: tryCatchOne
  118: tryCatchList
  117: tryCatch
  116: do
  115: hybrid_chain
  114: <reactive:plotObj>
   98: drawReactive
   85: renderFunc
   84: output$teal-teal_modules-missing_data-module-ADRS-summary_plot-plot_main
    3: runApp
    2: print.shiny.appobj
    1: <Anonymous>

@vedhav vedhav reopened this Oct 15, 2024
@m7pr
Copy link
Contributor

m7pr commented Oct 15, 2024

I also saw those rarely when testing teal.goshawk modules

@chlebowa
Copy link
Contributor Author

It does seem to happen more often in apps with more modules or when the load is otherwise increased.

@averissimo
Copy link
Contributor

This is a problem that originates with teal.widgets and should be fixed with: insightsengineering/teal.widgets#273

@chlebowa
Copy link
Contributor Author

chlebowa commented Dec 3, 2024

Thank you for the update, I will test at the earliest convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

6 participants