xpose.data: Create an Xpose data object

View source: R/xpose.data.R

xpose.dataR Documentation

Create an Xpose data object

Description

Creates an xpose.data object.

Usage

xpose.data(
  runno,
  tab.suffix = "",
  sim.suffix = "sim",
  cwres.suffix = "",
  directory = ".",
  quiet = TRUE,
  table.names = c("sdtab", "mutab", "patab", "catab", "cotab", "mytab", "extra",
    "xptab", "cwtab"),
  cwres.name = c("cwtab"),
  mod.prefix = "run",
  mod.suffix = ".mod",
  phi.suffix = ".phi",
  phi.file = NULL,
  nm7 = NULL,
  ...
)

Arguments

runno

Run number of the table files to read.

tab.suffix

Suffix to be appended to the table file names for the "real" data.

sim.suffix

Suffix to be appended to the table file names for any simulated data.

cwres.suffix

Suffix to be appended to the table file names for any CWRES data.

directory

Where the files are located.

quiet

A logical value indicating if more diagnostic messages should be printed when running this function.

table.names

Default text that Xpose looks for when searching for table files.

cwres.name

default text that xpose looks for when searching for CWRES table files.

mod.prefix

Start of model file name.

mod.suffix

End of model file name.

phi.suffix

End of .phi file name.

phi.file

The name of the .phi file. If not NULL then supersedes paste(mod.prefix,runno,phi.suffix,sep="").

nm7

T/F if table files are for NONMEM 7/6, NULL for undefined.

...

Extra arguments passed to function.

Details

Xpose expects, by default, to find at least one the the following NONMEM tables in the working directory to be able to create an Xpose data object (using a run number of '5' as an example):

sdtab5: The 'standard' parameters, including IWRE, IPRE, TIME, and the NONMEM default items (DV, PRED, RES and WRES) that are added when NOAPPEND is not present in the $TABLE record.

$TABLE ID TIME IPRE IWRE NOPRINT ONEHEADER FILE=sdtab5

patab5: The empirical Bayes estimates of individual model parameter values, or posthoc estimates. These are model parameters, such as CL, V2, ETA1, etc.

$TABLE ID CL V2 KA K F1 ETA1 ETA2 ETA3 NOPRINT NOAPPEND ONEHEADER FILE=patab5

catab5: Categorical covariates, e.g. SEX, RACE.

$TABLE ID SEX HIV GRP NOPRINT NOAPPEND ONEHEADER FILE=catab5

cotab5: Continuous covariates, e.g. WT, AGE.

$TABLE ID WT AGE BSA HT GGT HB NOPRINT NOAPPEND ONEHEADER FILE=cotab5

mutab5, mytab5, extra5, xptab5: Additional variables of any kind. These might be useful if there are more covariates than can be accommodated in the covariates tables, for example, or if you have other variables that should be added, e.g. CMAX, AUC.

The default names for table files can be changed by changing the default values to the function. The files that Xpose looks for by default are:

paste(table.names, runno, tab.suffix, sep="")

The default CWRES table file name is called:

paste(cwres.name,runno,cwres.suffix,tab.suffix,sep="")

If there are simulation files present then Xpose looks for the files to be named:

paste(table.names, runno, sim.suffix, tab.suffix, sep="") paste(cwres.name,runno,sim.suffix,cwres.suffix,tab.suffix,sep="")

This is basically a wrapper function for the read.nm.tables, Data and SData functions. See them for further information.

Also reads in the .phi file associated with the run (Individual OFVs, parameters, and variances of those parameters.)

Value

An xpose.data object. Default values for this object are created from a file called 'xpose.ini'. This file can be found in the root directory of the 'xpose4' package:

system.file("xpose.ini",package="xpose4").

It can be modified to fit the users wants and placed in the home folder of the user or the working directory, to override default settings.

Author(s)

Niclas Jonsson, Andrew Hooker

See Also

xpose.data-class, Data, SData, read.nm.tables, compute.cwres

Other data functions: add_transformed_columns, change_graphical_parameters, change_misc_parameters, compute.cwres(), data.checkout(), data_extract_or_assign, db.names(), export.graph.par(), export.variable.definitions(), import.graph.par(), import.variable.definitions(), make.sb.data(), nsim(), par_cov_summary, read.TTE.sim.data(), read.nm.tables(), read_NM_output, read_nm_table(), simprazExample(), tabulate.parameters(), xlabel(), xpose.print(), xpose4-package, xsubset()

Examples

# Here we create files from an example NONMEM run
 
od = setwd(tempdir()) # move to a temp directory
(cur.files <- dir()) # current files in temp directory

simprazExample(overwrite=TRUE) # write files
(new.files <- dir()[!(dir() %in% cur.files)])  # what files are new here?

xpdb <- xpose.data(1)


file.remove(new.files) # remove these files
setwd(od)  # restore working directory


## Not run: 

# We expect to find the required NONMEM run and table files for run
# 5 in the current working directory, and that the table files have
# a suffix of '.dat', e.g. sdtab5.dat
xpdb5 <- xpose.data(5, tab.suffix = ".dat") 

## End(Not run)


xpose4 documentation built on May 31, 2022, 5:07 p.m.