as.code: Convert to code

as.codeR Documentation

Convert to code

Description

Prints a block of code that can be used to replicate the input object.

Usage

as.code(M, start = "M = ", mode = "compact", quiet = FALSE)

## S4 method for signature 'struct_class'
as.code(M, start = "M = ", mode = "compact", quiet = FALSE)

## S4 method for signature 'model_seq'
as.code(M, start = "M = ", mode = "compact", quiet = FALSE)

## S4 method for signature 'iterator'
as.code(M, start = "M = ", mode = "compact", quiet = FALSE)

Arguments

M

a struct model, model_seq or iterator object

start

text prepended to the code. Default is "M = "

mode

"compact" will use the least amount of lines, "expanded" will put each object and input on a new line. "neat" will produce an output somewhere between "compact" and "expanded".

quiet

TRUE or FALSE to print code to console

Value

A string of code to reproduce the input object.

a string of code to reproduce the model

a string of code to reproduce the model sequence

a string of code to reproduce the iterator

Examples

M = example_model(value_1 = 10)
as.code(M)
M = example_model()
as.code(M)
M = example_model()
as.code(M)
M = example_model()
as.code(M)

computational-metabolomics/struct documentation built on March 27, 2024, 4:26 p.m.