Cast Data to Array or Matrix for Use in JAGS

make_array(
  df = bbs,
  val,
  row = c("rteno", "checklist_id"),
  col = "year",
  slice = "gridcellid",
  drop.na.rows = FALSE
)

Arguments

df

Data frame with three or more columns

val

target value to populate the matrix or array matrices

row

target rownames

col

target colnames

slice

target slice-by values

drop.na.rows

logical if TRUE will drop the values of arg "val" where is NA.