Description Usage Arguments Details Value Author(s)
Writes from R to file "towhere" text defining a list containing "DATA" in a form compatable with WinBUGS.
1 | writeDatafileR(DATA, towhere = "toWinBUGS.txt", fill = 80)
|
DATA |
either a data frame or else a list consisting of any combination of scalars, vectors, arrays or data frames (but not lists). If a list, all list elements that are not data.frames must be named. Names of data.frames in DATA are ignored. |
towhere |
file to receive output. Is "toWinBUGS.txt" by default. |
fill |
If numeric, number of columns for output. (Default is 80.) If FALSE, output will be on one line. If TRUE, number of columns is given by .Options$width. |
The function performs considerable checking of DATA argument. Since WinBUGS requires numeric input, no factors or character vectors are allowed. All data must be named, either as named elements of DATA (if it is a list) or else using the names given in data frames. Data frames may contain matrices. Arrays of any dimension are rearranged to be in row-major order, as required by WinBUGS. Scientific notation is also handled properly. In particular, the number will consist of a mantissa _containing a decimal point_ followed by "E", then either "+" or "-", and finally a _two-digit_ number.
Text defining a list is output to file "towhere".
Terry Elrod
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.