Skip to contents

Compile an odin model, yielding a dust_system_generator object.

Usage

odin(
  expr,
  input_type = NULL,
  quiet = FALSE,
  workdir = NULL,
  debug = FALSE,
  skip_cache = FALSE,
  compatibility = "warning"
)

Arguments

expr

Odin code as the path to a file (a string), a character vector of code, or as an expression (typically within braces {}).

input_type

An optional string describing the type of input for expr - must be one of file, text or expression. If given, this skips the type detection logic and odin will throw an error if the wrong type of input is given. Using this may be beneficial in programmatic environments.

quiet

Logical, indicating if compilation messages from pkgbuild should be displayed. Error messages will be displayed on compilation failure regardless of the value used.

workdir

Optional working directory to use. If NULL, we work in the session-specific temporary directory. By using a different directory of your choosing you can see the generated code.

debug

Passed to pkgbuild::compile_dll, this will build a debug library.

skip_cache

Logical, indicating if the cache of previously compiled systems should be skipped. If TRUE then your system will not be looked for in the cache, nor will it be added to the cache after compilation.

compatibility

Compatibility mode to use. Valid options are "warning", which updates code that can be fixed, with warnings, and "error", which will error. The option "silent" will silently rewrite code, but this is not recommended for general use as eventually the compatibility mode will be removed (this option is primarily intended for comparing output of odin1 and odin2 models against old code).

Value

A dust_system_generator object, suitable for using with dust functions (starting from dust2::dust_system_create)