# NOT RUN {
# 1. run mantis shrimp example
original <- combine_sources(jags.1, mix, source, alpha,
groups=list(alphworm="alphworm",brittlestar="brittlestar",clam="clam",
crab="crab",fish="fish",snail="snail"))
# 2. combine 6 sources into 2 groups of interest (hard-shelled vs. soft-bodied)
# 'hard' = 'clam' + 'crab' + 'snail' # group 1 = hard-shelled prey
# 'soft' = 'alphworm' + 'brittlestar' + 'fish' # group 2 = soft-bodied prey
combined <- combine_sources(jags.1, mix, source, alpha.prior=alpha,
groups=list(hard=c("clam","crab","snail"), soft=c("alphworm","brittlestar","fish")))
plot_intervals(combined,toplot="fac1")
plot_intervals(original,toplot="fac1")
plot_intervals(combined,toplot="fac1",levels=1)
plot_intervals(combined,toplot="fac1",levels=2)
# }
Run the code above in your browser using DataLab