writeDatamlx: Write formatted data file

Description Usage Arguments Details Examples

View source: R/writeDatamlx.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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")

## End(Not run)

mlxR documentation built on Jan. 19, 2021, 5:06 p.m.