findTargets: Find target sizes for rarefaction of samples for multiple...

Description Usage Arguments Value Examples

View source: R/Rarefaction_funs.R

Description

Find target sizes for rarefaction of samples for multiple treatments down to a common size.

Usage

1
2
findTargets(nList, method = c("rankMatch", "randomMatch", "smallest"),
  maxit = 1000, debug = FALSE)

Arguments

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?

Value

a list of vectors of target sizes corresponding to the patches described in nList

Examples

 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))

bbolker/betararef documentation built on Sept. 17, 2021, 8:49 a.m.