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

define_parameter default #49

Merged
merged 2 commits into from
May 12, 2024
Merged

define_parameter default #49

merged 2 commits into from
May 12, 2024

Conversation

elong0527
Copy link
Collaborator

@elong0527 elong0527 commented May 12, 2024

Avoid unnecessary default values for forestly while calling metalite.ae.

The example below is from #20 to show it can properly handle define_parameters with default values.

Please merge #48 before this PR.

devtools::load_all()
library(metalite)

adae_tmp <- forestly_adae 
adae_tmp$AEACN[1:10] <- "DOSE REDUCED"

meta_new <- meta_adam(
  population = forestly_adsl,
  observation = adae_tmp
) |>
  define_plan(plan = metalite::plan(
    analysis = "ae_forestly",
    population = "apat",
    observation = "wk12",
    parameter = "any;ser;reduc"
  )
  ) |>
  define_population(
    name = "apat",
    group = "TRTA",
  ) |>
  define_observation(
    name = "wk12",
    group = "TRTA",
    label = "Weeks 0 to 24"
  ) |>
  define_parameter(
    name = "reduc",
    subset = AEACN == "DOSE REDUCED",
    label = "adverse events resulting in dose reduction"
  ) |>
  define_analysis(
    name = "ae_forestly",
    label = "Interactive forest plot"
  ) |>
  meta_build()

meta_new |>
  prepare_ae_forestly(parameter = "any;ser;reduc") |>
  format_ae_forestly() |>
  ae_forestly()

@elong0527 elong0527 requested a review from wangben718 May 12, 2024 02:35
@wangben718 wangben718 merged commit 35e26fd into main May 12, 2024
7 checks passed
@nanxstats nanxstats deleted the define-parameter-default branch May 13, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants