From b8ce29de790eb4a47435873a548cbbab4a025111 Mon Sep 17 00:00:00 2001 From: yilong zhang Date: Wed, 20 Dec 2023 04:53:21 +0000 Subject: [PATCH] allow user to specify treatment group (#15) --- R/meta_forestly.R | 10 ++++++---- man/meta_forestly.Rd | 9 ++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/R/meta_forestly.R b/R/meta_forestly.R index b78f3bb..f904f0f 100644 --- a/R/meta_forestly.R +++ b/R/meta_forestly.R @@ -21,11 +21,12 @@ #' @param dataset_adsl ADSL source dataset. #' @param dataset_adae ADAE source dataset. #' @param population_term A character value of population term name. +#' @param observation_term A character value of observation term name. #' @param population_subset An unquoted condition for selecting the #' populations from ADSL dataset. -#' @param observation_term A character value of observation term name. #' @param observation_subset An unquoted condition for selecting the #' observations from ADAE dataset. +#' @param treatment_group A character value of treatment group name. #' @param parameter_term A character value of parameter term name. #' #' @return A metalite object. @@ -43,9 +44,10 @@ meta_forestly <- function( dataset_adsl, dataset_adae, population_term, - population_subset = SAFFL == "Y", observation_term, + population_subset = SAFFL == "Y", observation_subset = SAFFL == "Y", + treatment_group = "TRTA", parameter_term = "any;rel;ser") { meta <- metalite::meta_adam( population = as.data.frame(dataset_adsl), @@ -59,13 +61,13 @@ meta_forestly <- function( )) |> metalite::define_population( name = population_term, - group = "TRTA", + group = treatment_group, subset = !!rlang::enquo(population_subset), label = "" ) |> metalite::define_observation( name = observation_term, - group = "TRTA", + group = treatment_group, subset = !!rlang::enquo(observation_subset), label = "" ) diff --git a/man/meta_forestly.Rd b/man/meta_forestly.Rd index 48ac999..95b27f3 100644 --- a/man/meta_forestly.Rd +++ b/man/meta_forestly.Rd @@ -8,9 +8,10 @@ meta_forestly( dataset_adsl, dataset_adae, population_term, - population_subset = SAFFL == "Y", observation_term, + population_subset = SAFFL == "Y", observation_subset = SAFFL == "Y", + treatment_group = "TRTA", parameter_term = "any;rel;ser" ) } @@ -21,14 +22,16 @@ meta_forestly( \item{population_term}{A character value of population term name.} +\item{observation_term}{A character value of observation term name.} + \item{population_subset}{An unquoted condition for selecting the populations from ADSL dataset.} -\item{observation_term}{A character value of observation term name.} - \item{observation_subset}{An unquoted condition for selecting the observations from ADAE dataset.} +\item{treatment_group}{A character value of treatment group name.} + \item{parameter_term}{A character value of parameter term name.} } \value{