set_vars: Set variable type, label or units

set_varsR Documentation

Set variable type, label or units

Description

Function designed to change the type, label or unit associated with variables.

Usage

set_var_types(xpdb, .problem = NULL, ..., auto_factor = TRUE, quiet)

set_var_labels(xpdb, .problem = NULL, ..., quiet)

set_var_units(xpdb, .problem = NULL, ..., quiet)

Arguments

xpdb

An xpose_data object.

.problem

The problem number to which the edits will be applied.

...

Specifications of the edits to be made to the xpdb index. Edits are made as type and variable pairs e.g. idv = 'TAD' will assign TAD to the type idv (independent variable).

auto_factor

With set_var_types only. If TRUE new columns assigned to the type 'catcov' will be converted to factor.

quiet

Logical, if FALSE messages are printed to the console.

Value

An xpose_data object

Recognized variable types

  • a: Compartments' amount

  • amt: Dose amount

  • catcov: Categorical covariate

  • contcov: Continuous covariate

  • dv: Dependent variable

  • dvid: DV identifier

  • eta: Eta

  • evid: Event identifier

  • id: Subject identifier

  • idv: Independent variable

  • ipred: Individual model predictions

  • mdv: Missing dependent variable

  • na: Not attributed

  • occ: Occasion flag

  • param: Model parameter

  • pred: Typical model predictions

  • res: Residuals

See Also

list_vars

Examples

# Change variable type
xpdb_2 <- set_var_types(xpdb_ex_pk, .problem = 1, idv = 'TAD')

# Change labels
xpdb_2 <- set_var_labels(xpdb_2, .problem = 1, ALAG1 = 'Lag time', CL = 'Clearance', V = 'Volume')

# Change units
xpdb_2 <- set_var_units(xpdb_2, .problem = 1, ALAG1 = 'h', CL = 'L/h', V = 'L')


xpose documentation built on July 9, 2023, 6:12 p.m.