runjags (version 0.9.0-4)

dump.format: Produce a Character String in the R Dump Format to Be Used With Jags

Description

Convert a named list of numeric vector(s) or array(s) of data or initial values to a character string in the correct format to be read by JAGS as either data or initial values, using the run.jags function.

Usage

dump.format(data=list())

Arguments

data
A named list of numeric or integer (or something that can be coerced to numeric) vectors, matrices or arrays. The name of each list item will be used as the name of the resulting dump.format variables. Alternatively, if the list is of length 2 and is no

Value

  • A charcter string in the R dump format.

See Also

run.jags

Examples

Run this code
initial.values.1 <- dump.format(list(mean="1", sd="0.1", lambda=matrix(1, ncol=3, nrow=10)))
initial.values.2 <- dump.format(list(mean="10", sd="10", lambda=matrix(10, ncol=3, nrow=10)))
data <- dump.format(list(N="10", Count=c(4,2,7,0,6,9,1,4,12,1)))

Run the code above in your browser using DataCamp Workspace