as.nmctl: Create, Manipulate, Read, and Write NONMEM Control Streams

Description Usage Arguments Details Value Author(s) References See Also

Description

This family of functions implements the class nmctl: an object model of the NONMEM control stream. nmctl models a control stream as a list of records; each record is a character vector. The read and write functions (not generic) convert nmctl to and from file format. The print, format, and as.character methods display nmctl as it normally looks in a text editor. as.list.nmctl simply unclasses its argument. as.nmctl.character does the heavy work, breaking up a character vector into records and storing as a list. If parse is TRUE, as.nmctl attempts to convert certain records to higher-level objects: currently the theta record will be converted to initList .

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## S3 method for class 'nmctl'
as.character(x, ...)
## S3 method for class 'nmctl'
as.list(x, ...)
## S3 method for class 'character'
as.nmctl(
	x,
	pattern='^ *\\$([^ ]+)( .*)?$',
	head='\\1',
	tail='\\2',
	parse=FALSE,
	...
)
## S3 method for class 'nmctl'
format(x, ...)
## S3 method for class 'nmctl'
print(x, ...)
read.nmctl(con,parse=FALSE, ...)
write.nmctl(
	x, 
	file = "data", 
	ncolumns = 1, 
	append = FALSE, 
	sep = " ",
	...
)
## S3 method for class 'nmctl'
x[..., drop = TRUE]
## S3 method for class 'nmctl'
x[[..., drop = TRUE]]

Arguments

x

an nmctl object (or analogous character vector)

...

extra arguments passed to other functions

pattern

regular expression for first line of a control record

head

regular expression (relative to pattern) giving the name of the control record

tail

regular expression (relative to pattern) giving the balance of the control record

con

a connection or the name of a file to open

parse

whether to create R objects from the character vectors serving as records

file

passed to write

ncolumns

passed to write

append

passed to write

sep

passed to write

drop

coerce to lowest possible dimension

Details

Serendipitously, the record indicator in NONMEM control stream syntax is the same as the element selector in R list syntax: $. The convention is that names of elements in nmctl (lower case) are converted to record types (upper case) in the control stream. The user is free to add, delete, rearrange, and edit records using standard list manipulation techniques. When printed, records appear in list order. The write function warns if the 80 character limit is exceeded (not including comments).

Value

as.character.nmctl

a character vector representing a control stream

as.list

a list representing a control stream

as.nmctl.character

a control stream object

format.nmctl

character

print.nmctl

character

read.nmctl

a control stream object

write.nmctl

used for side effects

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also


metrumrg documentation built on May 2, 2019, 5:55 p.m.