getCovT: Processes domain data for time-varying covariates

View source: R/get_MappedColumns.R

getCovTR Documentation

Processes domain data for time-varying covariates

Description

Processes domain data for time-varying covariates

Usage

getCovT(.data, ID, TIME, EVID, covT.col, covT.val, covT.filter,
  fun.summary, Units, ...)

Arguments

.data

The domain data frame

ID

A column name or expression for the subject identifier.

TIME

A column name or expression for the TIME column.

EVID

A column name or expression for the EVID column.

covT.col

The name of the column that holds the desired covariate names

covT.val

The name of the column that holds the covariate values

covT.filter

Filter expression to apply to subset the data.

fun.summary

A function name (or named list/vector) as a text string to use if more than one value per (ID, TIME) is encountered.

Units

The name of the column holding the covariate units (if stacked).

...

Additional column mappings.

Details

The input data is filtered, if a filter expression is provided. ID and TIME must be specified, but other arguments are optional. If EVID is not provided, it will default to '2'. Provide cov.col and cov.val both to indicate that the data are in long format. In this case the values in cov.col (that remain after the filter is applied) will become new columns with the values specified in cov.val (a data widening operation). The ID and TIME columns will be repeated for each covariate value row.

If covT.col and covT.val are not provided, then after filtering the expressions given as additional column mappings will be selected from .data

This function uses non-standard evaluation, so the ... arguments do not need to be quoted. For example, to compute a date from ISO-8601 strings include TIME=parsedate::parse_date(EXSTDTC). Of course the actual column may have a different name. Extra arguments (...) must be named, for example: MYVALUE = pmax(0,DV).

Value

A data_frame with the mapped data


qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.