Data for OpenBUGS or WinBUGS called from R using the package
R2WinBUGS (Sturtz et al. 2005) take the form of an R list.
These functions are limited at present to binary data from a square
quadrat such as used by Royle and Young (2008). Marques et al. (2011)
provide an R function create.data()
for generating simulated
datasets of this sort (see sim.capthist
for equivalent
functionality).
When reading BUGS data --
The character values Y
, xcoord
, ycoord
,
xmin
etc. are used to locate the data within DAlist
,
allowing for variation in the input names.
The number of sampling occasions is taken from the number of columns
in Y
. Each value in Y
should be 0 or 1. Coordinates may
be missing
A numeric value for buffer
is the distance (in the original
units) by which the limits Xl, Xu etc. should be shrunk to give the
actual plot limits. If buffer
is character then a component of
DAlist
contains the required numeric value.
Coordinates in the output will be multiplied by the scalar
units
.
Augmentation rows corresponding to `all-zero' detection histories in
Y
, xcoord
, and ycoord
are discarded.
When writing BUGS data --
Null (all-zero) detection histories are added to the matrix of
detection histories Y
, and missing (NA) rows are added to the
coordinate matrices xcoord
and ycoord
.
Coordinates in the output will be divided by the scalar
units
.