# Toy example with Pacific Wren sample data
# First, stratify the sample data
strat_data <- stratify(by = "bbs_cws", sample_data = TRUE)
# Prepare the stratified data for use in a JAGS model. In this
# toy example, we will set the minimum year as 2009 and
# maximum year as 2018, effectively only setting up to
# model 10 years of data. We will use the "first difference
# model.
jags_data <- prepare_jags_data(strat_data = strat_data,
species_to_run = "Pacific Wren",
model = "firstdiff",
min_year = 2009,
max_year = 2018)
# Obtain the reassembled data frame for the data sent to JAGS
prepped_data <- get_prepared_data(jags_data = jags_data)
Run the code above in your browser using DataLab