Skip to content

Commit

Permalink
chore: #2091 address errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zelos Zhu committed Sep 10, 2023
1 parent 1d72836 commit f8eab87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/derive_param_doseint.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ derive_param_doseint <- function(dataset,
aval_tadm <- sym(paste0("AVAL.", tadm_code))
aval_tpdm <- sym(paste0("AVAL.", tpadm_code))

analysis_value <- exprs(AVAL = !!aval_tadm / !!aval_tpdm * 100)

# handle 0 doses planned if needed
if (zero_doses == "100") {
update_aval <- exprs(
Expand All @@ -143,14 +145,14 @@ derive_param_doseint <- function(dataset,
)
)
} else {
update_aval <- exprs(AVAL = !!aval_tadm / !!aval_tpdm * 100)
update_aval <- NULL
}

derive_param_computed(
dataset,
filter = !!filter,
parameters = c(tadm_code, tpadm_code),
by_vars = by_vars,
set_values_to = expr_c(set_values_to, update_aval)
set_values_to = expr_c(set_values_to, analysis_value, update_aval)
)
}

0 comments on commit f8eab87

Please sign in to comment.