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

Fix modules to use teal_data instead of tdata #234

Closed
10 tasks
chlebowa opened this issue Nov 23, 2023 · 0 comments
Closed
10 tasks

Fix modules to use teal_data instead of tdata #234

chlebowa opened this issue Nov 23, 2023 · 0 comments
Assignees

Comments

@chlebowa
Copy link
Contributor

part of insightsengineering/teal#937

installation instructions:

staged.dependencies::dependency_table(
  project = "insightsengineering/teal.osprey@https://github.com",
  project_type = "repo@host",
  ref = "refactor",
  verbose = 1
) |>
staged.dependencies::install_deps()

steps:

  1. Assign yourself by writing your name next to the module in "Progress list" below.
  2. Open separate branch tm_module_of_your_choice@refactor.
  3. Make changes relevant changes.
  4. Make PR to the @refactor branch with only one module changed. ONE PR, ONE MODULE. Include example app in the initial comment!
  5. Add a link to the PR next to the "Progress list".

example changes

  • argument checks
# from
checkmate::assert_class(data, "tdata")
  
# to
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
  • merge expressions
# from 
anl_merged_q <- reactive({	   
  req(anl_merged_input())
  teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)) %>% 
      teal.code::eval_code(as.expression(anl_merged_input()$expr))
})
# to
anl_merged_q <- reactive({
  req(anl_merged_input())
  data() %>%
    teal.code::eval_code(as.expression(anl_merged_input()$expr))
})
  • validation rules
iv$add_rule("variables", shinyvalidate::sv_in_set(
 # set = names(data[[dataname]]()), message_fmt = "Not all selected variables exist in the data" # old
 set = names(data()[[dataname]]), message_fmt = "Not all selected variables exist in the data" # new
))
  • arm_ref_comp
    arm_ref_comp_iv <- arm_ref_comp_observer(
      session,
      input,
      output,
      id_arm_var = extract_input("arm_var", parentname),
      # data = data[[parentname]],                               # old
      data = reactive(data()[[parentname]]),                        # new
      arm_ref_comp = arm_ref_comp,
      module = "tm_mmrm"
    )

Progress list:

  • tm_g_ae_oview
  • tm_g_ae_sub
  • tm_g_butterfly
  • tm_g_decorate
  • tm_g_events_term_id
  • tm_g_heat_bygrade
  • tm_g_patient_profile
  • tm_g_spiderplot
  • tm_g_swimlane
  • tm_g_waterfall
@chlebowa chlebowa closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant