Description Usage Arguments Value Examples
View source: R/Rarefaction_funs.R
Find target sizes for rarefaction of samples for multiple treatments down to a common size.
1 2 | findTargets(nList, method = c("rankMatch", "randomMatch", "smallest"),
maxit = 1000, debug = FALSE)
|
nList |
a list of numeric vectors of patch sizes (total abundances) for each treatment |
method |
(character): 'smallest' to use the smallest abundance found in any patch in any treatment; 'rankMatch' to match patches by rank within treatment and use the smallest abundance within a rank category; 'randomMatch' to match patches into groups at random. The idea of the default 'rankMatch' is that by matching patches by rank we rarefy as little as necessary to get equal patch sizes in the two groups – i.e. the minimum in both groups is the same, etc. (I can't prove that this minimizes the required amount of rarefaction, and I'm not even sure it's always true, but in any case it seems to be a reasonable approach.) |
maxit |
number of iterations to try for randomized algorithms |
debug |
debugging output? |
a list of vectors of target sizes corresponding to the patches described in nList
1 2 3 4 5 6 7 8 9 10 11 | ## make sure that the order of the patches (i.e. order of number
## of fish in each patch) doesn't matter
nList <- list(1:10,10:1)
findTargets(nList) ## unchanged
## three treatments
nList <- list(5:10,9:4,c(2,7,8,1,20,8))
f1 <- findTargets(nList)
## unequal numbers of patches
nList <- list(5:10,1:10)
set.seed(101)
(f2 <- findTargets(nList))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.