% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prepare_exp_duration.R
\name{prepare_exp_duration}
\alias{prepare_exp_duration}
\title{Prepare data for exposure duration table}
\usage{
prepare_exp_duration(
  meta,
  analysis = "exp_dur",
  population = meta$plan[meta$plan$analysis == analysis, ]$population,
  parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse =
    ";")
)
}
\arguments{
\item{meta}{A metadata object created by metalite.}

\item{analysis}{A character value of analysis term name.
The term name is used as key to link information.}

\item{population}{A character value of population term name.
The term name is used as key to link information.}

\item{parameter}{A character value of parameter term name.
The term name is used as key to link information.}
}
\value{
A list of analysis raw datasets.
}
\description{
Prepare data for exposure duration table
}
\examples{
meta <- metalite::meta_adam(
  population = metalite_sl_adexsum,
  observation = metalite_sl_adexsum
) |>
  metalite::define_plan(metalite::plan(
    analysis = "exp_dur", population = "apat",
    observation = "apat", parameter = "expdur"
  )) |>
  metalite::define_population(
    name = "apat", group = "TRTA", subset = APERIOD == 1 & AVAL > 0
  ) |>
  metalite::define_parameter(
    name = "expdur", subset = PARAMCD == "TRTDURD", var = "AVAL",
    label = "Exposure Duration (Days)", vargroup = "EXDURGR"
  ) |>
  metalite::define_analysis(
    name = "exp_dur", title = "Summary of Exposure Duration",
    label = "exposure duration table"
  ) |>
  metalite::meta_build()

meta |> prepare_exp_duration()
}
