applyPredCode: Parses and applys NONMEM statements

Description Usage Arguments Details Value Author(s) Examples

Description

Parses NONMEM statements and attempts to apply them to a data frame in order to create a response variable

Usage

1
2
3
4
5
6
7
8
applyPredCode(df, 
  pred, 
  respCol = getEctdColName("Response"), 
  report = TRUE, 
  keepCols = respCol, 
  verbose = getEctdVerbose()) 

parsePredCode(model, respCol = getEctdColName("Response")) 

Arguments

df

(Required) Data frame to which parsed NONMEM statements are to be applied

pred

Character vector of NONMEM statements

respCol

Response column name ( iven by getEctdColName by default)

report

Logical: should a textual report be produced?

keepCols

Character vector of column names to retain in the return dataset

verbose

Logical: Should verbose logging be used? ( given by getEctdVerbose by default)

model

File containing analysis code (for R or SAS) or an R function for analysis (R only)

Details

The applyPredCode function calls the parsePredCode function in order to convert the NONMEM statements to executable R statements. The applyPredCode function then iteratively "tries" to apply these statements to the data ("df"), producing a textual report of the process if "report" is set to TRUE. The "keepCols" columns from the updated dataset are then returned

Value

A dataset with new columns added

Author(s)

Mike K Smith mstoolkit@googlemail.com

Examples

1
2
3
4
5
parsePredCode(c(
	"X = 1",
	"IF (X.EQ.1.OR.Y.GT.0) STUD = 1",
 	"NEWVAR = THETA(1) + EXP(ETA(2))**LOG(EPS(1))"
))

MSToolkit documentation built on May 2, 2019, 6:30 p.m.