Learn R Programming

nonmemica (version 0.9.1)

likebut: Modify a Model

Description

Makes a copy of a model in a corresponding directory. Problem statement is updated to reflect that the model is LIKE the reference model BUT different in some fundamental way.

Usage

likebut(x, but = "better", y = NULL, project = getOption("project",
  getwd()), nested = getOption("nested", TRUE), overwrite = FALSE,
  ext = getOption("modex", "ctl"), include = "\\.def$", ...)

Arguments

x

a model name, presumably interpretable as numeric

but

a short description of the characteristic difference from x

y

optional name for model to be created, auto-incremented by default

project

project directory

nested

model files nested in run-specific directories

overwrite

whether to overwrite y if it exists

ext

extension for the model file

include

regular expressions for files to copy to new directory

...

passed arguments

Value

the value of y

See Also

runlog.character

Examples

Run this code
# NOT RUN {
# Create a working project.
source <- system.file(package = 'nonmemica','project')
target <- tempdir()
target <- gsub('\\\\','/',target) # for windows
source
target
file.copy(source,target,recursive = TRUE)
project <- file.path(target,'project','model')

# Point project option at working project
options(project = project)
library(magrittr)

# Derive models.
1001 %>% likebut('revised',y = 1002, overwrite=TRUE )

# At this point, edit 1002.ctl to match whatever 'revised' means.
# Then run it with NONMEM.
# }

Run the code above in your browser using DataLab