addDerivedCategorical: Add binned variable to NONMEM object

Description Usage Arguments Value Note Author(s) Examples

View source: R/createCategorical.R

Description

This function allows the user to create new variables derived from actual input or output data stored in a NONMEM object or a data.frame. The function "bins" the data in a user-chosen manner. The new "binned" variable will be added to the "additionalVars" data frame of the object, or as a new column if the object is a data.frame. The methods for creating the categorical variables are:

Usage

1
2
addDerivedCategorical(obj, varName, newVar=paste(varName, ".CUT", sep = ""), 
breaks=5, binType="range", labels, ...)

Arguments

obj

An object of class NMBasicModel, NMRun, NMSimModel, NMSimDataGen or data.frame

varName

The variable to "bin"

newVar

The name of the new variable

breaks

The number of breaks

binType

The type of "binning"

labels

The labels for the "bins"

...

Additional arguments that apply to different classes. These are dataType which specifies what data to use, i.e input or output, for NMBasicModel, NMRun, NMSimModel and NMSimDataGen, and problemNum which specifies the required run for an NMRun object

Value

A new object with a user-specified "binned" variable added

Note

If the binType is counts and calculation of quantiles generates duplicates, a warning will be eliminated and the duplicates will be discarded.

Author(s)

Mango Solutions

Examples

1
2
x <- addDerivedCategorical(mtcars, "mpg", breaks = 6, binType = "counts" )
show(x$mpg.CUT)

RNMImport documentation built on May 2, 2019, 5:21 p.m.