Learn R Programming

mlxR (version 4.2.0)

writeDatamlx: Write formatted data file

Description

Write data contained in a list of dataframes in a single file (NONMEM/Monolix format) or in several files as tables

Usage

writeDatamlx(
  r,
  result.file = NULL,
  result.folder = NULL,
  sep = ",",
  ext = NULL,
  digits = 5,
  app.file = F,
  app.dir = F,
  project = NULL
)

Arguments

r

a list of dataframes

result.file

a string with the name of the file

result.folder

a string with the name of the folder

sep

(default = ",")

ext

a string with the extension of the file names

digits

(default = 5)

app.file

TRUE/FALSE (default=FALSE) append to file

app.dir

TRUE/FALSE (default=FALSE) append to dir

project

A Monolix project

Details

See http://simulx.webpopix.org/mlxr/writedatamlx/ for more details.

Examples

Run this code
# NOT RUN {
modelPK <- inlineModel("
[LONGITUDINAL]
input = {V, Cl, a1}
EQUATION:
Cc = pkmodel(V, Cl)
DEFINITION:
y1 ={distribution=lognormal, prediction=Cc, sd=a1}
")
adm  <- list(amount=100, time=seq(0,50,by=12))
p <- c(V=10, Cl=1, a1=0.1)
y1 <- list(name=c('y1'), time=seq(5,to=50,by=5))
res <- simulx(model=modelPK, treatment=adm, parameter=p, output=y1)
writeDatamlx(res, result.file="res.csv")
writeDatamlx(res, result.file="res.txt", sep="\t")
writeDatamlx(res, result.folder="res")
# }

Run the code above in your browser using DataLab