Learn R Programming

BRugs (version 0.8-2)

bugsData: Writing input for OpenBUGS

Description

Write data file for OpenBUGS.

Usage

bugsData(data, fileName = file.path(tempdir(), "data.txt"),
         format="E", digits = 5)

Arguments

data
Either a named list (names corresponding to variable names in the model file) of the data for the OpenBUGS model, or a vector or list of the names of the data objects used by the model
fileName
The filename, defaults to data.txt in the temporary directory of the current R session
format
String to pass to formatC which controls formatting of numbers. The default "E" formats all numbers in scientific notation. The alternative "fg" uses a standard format,
digits
Number of significant digits used for OpenBUGS input, see formatC. This may need to be adjusted from the default of 5, for example when writing large integers.

Value

  • Invisibly returns the fileName.

concept

data

See Also

BRugs