Learn R Programming

RStanTVA (version 0.3.2)

model_code: Extract Stan code

Description

Extracts the Stan code from a StanTVA model object.

Usage

model_code(object, type)

# S4 method for stanmodel model_code(object, type = c("stan", "stan2", "cpp"))

# S4 method for stanfit model_code(object, type)

Value

A RStanTVA model code object (stan), or a string containing the code (stan2 or cpp).

Arguments

object

A StanTVA model object or fit.

type

The type of code to return (stan: formatted StanTVA, stan2: ready-to-compile Stan code, cpp: generated C++ code).

Methods (by class)

  • model_code(stanmodel): method

  • model_code(stanfit): Extract code from a model fit

Examples

Run this code
if (FALSE) {
model <- stantva_model(locations = 2)
model_code(model)
}

Run the code above in your browser using DataLab