Read data for a JAGS model from a file.
name of a file containing a text repesentation of the data for a jags model
The command line interface for JAGS reads data and initial values from
a text file. The data format used for jags data files is the same as the R
dump function. Thus the data values can be read into an
R session using the
source function, but this will create
objects in the global environment. The
is a simple wrapper that reads the data into a list instead.
OpenBUGS also reads data and initial values from a text file. The
format of these files is described as "S-PLUS" format by the OpenBUGS
authors. It superficially resembles the format used by the
function (and in fact can be parsed by the
function). However, in BUGS "S-PLUS" format, arrays are stored in
row-major order instead of the column-major order used by R. The
read.bugsdata function reads OpenBUGS "S-PLUS" format files and
permutes the elements of arrays so that they appear in the correct
Either function returns a list which can be used as the
inits argument of
A named list of numeric vectors or arrays.
Earlier versions of the rjags package had a
which read data in either format, but the function name was ambiguous
(There are many data file format in R) so this is now deprecated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.