model.character {rube}R Documentation

Show the model code for a text model

Description

Show the code for a text model or file containing the model as text. This show a nicely formatted version of the model code, optionally substituting subs, cases, and varLists.

Usage

## S3 method for class 'character'
model(x, ..., indent="  ", lineNumbers=TRUE)

Arguments

x

rube code as text or filename of a text file with rube code

...

optional arguments passed to showModel

indent

the string used for indenting ("\\t" is OK)

lineNumbers

a logical value indicating lineNumbers should be shown

Details

Displays the model code with indenting. Optional arguments include 'subs' (a named list of the form WHAT=value that defines overrides for any default values; 'cases' (a string vector of values used to define IFCASE); and 'varList' (a named list of string vectors in the form of model formulas).

Value

Returns NULL invisibly.

Author(s)

Howard J. Seltman <hseltman@stat.cmu.edu>

Examples

  m = "model {
        for (i in 1:5) {
          x[i]~dnorm(mu,1)
        }
        mu~dnorm(0,MU.PREC=0.01)
      }"
  model(m, subs=list(MU.PREC=0.001))

[Package rube version 0.3-11 Index]