## Fatty Acids
data(FAset)
fa.set = as.vector(unlist(FAset))
## Predators
data(predatorFAs)
tombstone.info = predatorFAs[,1:4]
predator.matrix = predatorFAs[, fa.set]
npredators = nrow(predator.matrix)
## Prey
prey.sub = preyFAs[, fa.set]
prey.sub = prey.sub / apply(prey.sub, 1, sum)
group = as.vector(preyFAs$Species)
prey.matrix.full = cbind(group,prey.sub)
prey.matrix = MEANmeth(prey.matrix.full)
## Calibration Coefficients
data(CC)
cal.vec = CC[CC$FA %in% fa.set, 2]
cal.mat = replicate(npredators, cal.vec)
# Note: uncomment examples to run. CRAN tests fail because execution time > 5 seconds
# diet.est <- p.QFASA(predator.mat = predator.matrix,
# prey.mat = prey.matrix,
# cal.mat = cal.mat,
# dist.meas = 2,
# start.val = rep(1,nrow(prey.matrix)),
# ext.fa = fa.set)[['Diet Estimates']]
#
# bias <- bias.all(p.mat = diet.est,
# prey.mat = prey.matrix.full,
# cal.mat = cal.mat,
# R.bias = 10,
# noise = 0,
# nprey = 50,
# dist.meas = 2,
# ext.fa = fa.set)
Run the code above in your browser using DataLab