[R-sig-genetics] Bootstrapping of genind objects
Bhuller, Ravneet
ravneet.bhuller13 at imperial.ac.uk
Thu Jan 26 17:58:35 CET 2017
Dear Members,
I have done the following to estimate mean allelic richness for each of the sampled genind objects:
# Subset the genind object by population
obj<- seppop(niger.data.genind)
# Sample and repool the populations to create a list of genind objects
repooled <- lapply(seq(2, nPop(niger.data.genind), by=1), function(n) repool(obj[sample(nPop(niger.data.genind), n, replace= FALSE)]))
# Calculate mean(allel.rich(e)$mean.richness for each genind object
lapply(repooled, function(e) mean(allel.rich(e)$mean.richness, na.rm = TRUE))
But, I also want to estimate variances and confidence intervals by bootstrapping the above samples with 10,000 repetitions. I have tried my best to solve it with chao_bootstrap() and replicate() but it is not working. Please if someone can guide me how to bootstrap the above samples with 10,000 repetitions.
Many thanks for your help.
Kind regards,
Rav
More information about the R-sig-genetics
mailing list