Display the Code to Generate an Object

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
get_code(x, ...)

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

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

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

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

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

## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
p <- define_parameters(
  a = 2,
  b = 3 * x + 1
)

get_code(p)

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

get_code(m)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.