pseudo.pred {QFASA} | R Documentation |
Note: if preysize=1, then one prey is selecting from each species. otherwise, a sample of size n_k (number of species k) is sampled with replacement.
pseudo.pred(diet, preybase, cal.vec, fat.vec, preysize = 2)
diet |
compositional vector of proportions that sums to one. Length is equal to the number of prey species. |
preybase |
prey database with first column providing the species name. |
cal.vec |
vector of calibration coefficients. |
fat.vec |
vector of fat content whose length is the same as the number of species. |
preysize |
number of prey to sample from prey database. |
a simulated predator FA signature
data(preyFAs) # Note: uncomment examples to run. CRAN tests fail because execution time > 5 seconds # p.mat <- matrix(rep(NA,100*11),nrow=100) # for (i in 1: 100) { # my.seal <- pseudo.pred(rep(1/11,11), # preyFAs[,-c(1,3)], # rep(1,ncol(preyFAs[,-c(1,3)])-1), # rep(1,11)) # p.mat[i,] <- p.QFASA(my.seal, # MEANmeth(preyFAs[,-c(1,3)]), # rep(1,length(my.seal)), # 2, # ext.fa=colnames(preyFAs[,-c(1:3)]))$`Diet Estimates` # } # # Average diet estimate # round(apply(p.mat,2,mean),3)