Skip to contents

Writes an NlmePmlModel object to a text based metamodel file (.mmdl).

Usage

write_mmdl(
  model,
  file,
  datafile,
  author = "",
  engineParams = NULL,
  tableParams = NULL,
  absolutePaths = FALSE
)

Arguments

model

An NlmePmlModel object.

file

Output metamodel file path to create/overwrite.

datafile

Input data file path to write into the ## DATA block.

author

Optional author string to write into the metamodel.

engineParams

Optional NlmeEngineExtraParams object created by engineParams() to serialize into the ## ESTARGS block. Only arguments that differ from engineParams() defaults for this model (and estimation method) are written, so the block lists explicit overrides only.

tableParams

Optional table definition(s) created by tableParams() (i.e., NlmeTableDef and/or NlmeSimTableDef, or a list of them) to serialize into the ## TABLES block.

absolutePaths

Logical; how to write the datafile path into the ## DATA block. FALSE (default) makes it relative to the metamodel directory (e.g. ./data.csv), producing portable metamodels. TRUE writes the normalized absolute path. When a relative path cannot be expressed (different Windows drive) the function warns and falls back to absolute.

Value

Invisible file.