make_OCC_every_dose: Make an OCC column for NONMEM IOV use

View source: R/make_OCC_every_dose.R

make_OCC_every_doseR Documentation

Make an OCC column for NONMEM IOV use

Description

[Experimental]

Creates and OCC column that increments in accordance to specified condition. To be used in a dplyr::mutate() statement dplyr::group_by()'d by "ID".

Usage

make_OCC_every_dose(d, dose_trigger, new_OCC_trigger)

Arguments

d

A data.frame. NONMEM ready input dataset.

dose_trigger

Logical expression for defining a dosing row.

new_OCC_trigger

Logical expression for defining when OCC should increment.

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

d <- input_data(m1)

## OCC increments on every dosing interval with more than 4 samples
d %>% make_OCC_every_dose(!is.na(AMT), any(!is.na(DV)))


NMproject documentation built on Sept. 30, 2022, 1:06 a.m.