Learn R Programming

heemod (version 0.9.0)

get_code: Display the Code to Generate an Object

Description

This function returns the R code to generate an heemod object.

Usage

get_code(x, ...)

# S3 method for uneval_parameters get_code(x, name = NULL, depth = 0, n_space = 2, ...)

# S3 method for uneval_matrix get_code(x, name = NULL, depth = 0, n_space = 2, ...)

# S3 method for state get_code(x, name = NULL, depth = 0, n_space = 2, ...)

# S3 method for uneval_state_list get_code(x, depth = 0, n_space = 2, ...)

# S3 method for uneval_model get_code(x, name = NULL, sub = FALSE, depth = 0, n_space = 2, ...)

# S3 method for run_model get_code(x, name = NULL, sub = FALSE, depth = 0, n_space = 2, ...)

Arguments

x
An heemod object.
...
Additional parameters passed to methods.
name
character. Optional argument giving the name to assign to the object.
depth
Depth of the function call.
n_space
Number of space used for indentation.
sub
logical. Should states or models be referenced by name in define_strategy and run_model instead of including the entire code?

Value

A character string.

Examples

Run this code

p <- define_parameters(
  a = 2,
  b = 3 * x + 1
)

get_code(p)

m <- define_transition(
  C, .1,
  0, 1 
)

get_code(m)

Run the code above in your browser using DataLab