likebut: Modify a Model

View source: R/likebut.R

likebutR Documentation

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$",
  update = FALSE,
  ...
)

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 (can be expression)

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

update

use final estimates of x as initial estimates of y

...

passed arguments, including PsN runrecord elements (experimental)

Value

the value of y

See Also

runlog.character

Examples

# 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.

bergsmat/nonmemica documentation built on Sept. 15, 2023, 9:22 a.m.