set_data: Set a controller data set

View source: R/pmxClass.R

set_dataR Documentation

Set a controller data set

Description

Set a controller data set

Usage

set_data(ctr, ..., envir = parent.frame())

Arguments

ctr

the controller object

...

a named list parameters (see example)

envir

the environment in which expr is to be evaluated. May also be NULL, a list, a data frame, a pairlist or an integer as specified to sys.call.

Details

This function can be used to set an existing data set or to create a new one. The basic idea is to change the built-in data set (change the factor level names, change some rows values or apply any other data set operation) and use the new data set using the dname parameter of pmx_plot family functions.

See Also

Other pmxclass: get_cats(), get_conts(), get_covariates(), get_data(), get_occ(), get_plot_config(), get_plot(), get_strats(), plot_names(), plots(), pmx_update(), set_plot()

Examples


ctr <- theophylline()
dx <- ctr %>% get_data("eta")
dx <- dx[, EFFECT := factor(
  EFFECT,
  levels = c("ka", "V", "Cl"),
  labels = c("Concentration", "Volume", "Clearance")
)]
## update existing data set
ctr %>% set_data(eta = dx)
## or create a new data set
ctr %>% set_data(eta_long = dx)


ggPMX documentation built on July 9, 2023, 7:45 p.m.