insightsengineering / teal.modules.clinical

Provides teal modules for the standard clinical trials outputs
https://insightsengineering.github.io/teal.modules.clinical/
Other
32 stars 17 forks source link

[Question]: How do I run the examples. #1236

Closed wvictor14 closed 1 month ago

wvictor14 commented 1 month ago

What is your question?

Problem: Examples can't run due to broken dependencies

Hi, I am beginning to learn about teal and related packages and how we can use it at my company. I have a lot of R experience but am unfamiliar with pharmaverse / teal, and actually clinical trial data in general. Please excuse me if I miss some obvious documentation related to teal, ADaM, or other...

I am interested in a few of the modules in teal.modules.clinical but I cannot figure out how to run the examples in the docs. They all require loading the archived package scda to load example data. I think I may have figured out how to rely on random.cdisc.data (which I assume is the successor to scda but I am not sure about that).

But now I see that there are further broken dependencies in the few examples I looked at:

cdisc_dataset function is defunc, it seems to be replaced with teal_data. I gave up (rather quickly) trying to figure out how to update the example code.

questions

  1. Is it possible to run the examples with up-to-date packages and functions?

documentation in question:

https://insightsengineering.github.io/teal.modules.clinical/v0.8.14/reference/tm_t_events_summary.html

Example code from about reference pasted below:

tm_t_events_summary(
  label,
  dataname,
  parentname = ifelse(inherits(arm_var, "data_extract_spec"),
    teal.transform::datanames_input(arm_var), "ADSL"),
  arm_var,
  flag_var_anl = NULL,
  flag_var_aesi = NULL,
  dthfl_var =
    teal.transform::choices_selected(teal.transform::variable_choices(parentname,
    "DTHFL"), "DTHFL", fixed = TRUE),
  dcsreas_var =
    teal.transform::choices_selected(teal.transform::variable_choices(parentname,
    "DCSREAS"), "DCSREAS", fixed = TRUE),
  llt = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
    "AEDECOD"), "AEDECOD", fixed = TRUE),
  aeseq_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
    "AESEQ"), "AESEQ", fixed = TRUE),
  add_total = TRUE,
  count_subj = TRUE,
  count_pt = TRUE,
  count_events = TRUE,
  pre_output = NULL,
  post_output = NULL,
  basic_table_args = teal.widgets::basic_table_args()
)

Again, sorry if I have missed some obvious documentation. There is a lot of teal packages and am trying to navigate my way through it all. Thanks for patience

Code of Conduct

Contribution Guidelines

Security Policy

edelarua commented 1 month ago

Hi @wvictor14,

Thanks for reaching out!

Please ensure that you are running the latest version of teal.modules.clinical available on CRAN, v0.9.1. The example that you linked was taken from version 0.8.14 so will be incompatible, but the updated version of the same example is available here: https://insightsengineering.github.io/teal.modules.clinical/latest-tag/reference/tm_t_events_summary.html

The scda package has been retired in favour of random.cdisc.data, but the teal.modules.clinical package contains some example datasets that can be used to run the examples.

If you are running version 0.9.1, try running the example I have linked above and if you are still running into issues please let me know and I can try to help resolve.

shajoezhu commented 1 month ago

thanks @edelarua for answering the question

dear @wvictor14 , I hope the above answers your question. I am closing this issue for now. If you need further clarification, please post the question on StackOverflow with the tag nest-teal https://stackoverflow.com/questions/tagged/nest-teal Thank you!

wvictor14 commented 1 month ago

not sure how I ended up on that old example page... Thanks @edelarua !