|
|
|
Simulated 100-cell box subsampler
sub.sample {sub.sample}
Description
Produces simulated random subsamples of species counts in a sample-by-species matrix
Usage
sub.sample(x, fixed.percentage = FALSE, min.count = TRUE, count = 300,
tolerance = 5, min.percentage = FALSE, percentage = 10, max.percentage = 90)
Arguments
x
|
a data frame with samples in columns and taxa in rows |
fixed.percentage
|
if TRUE, all columns are subsampled by a fixed percentage, as
defined by percentage. (Overrides min.count and
min.percentage) |
min.count
|
if TRUE, each subsample contains a minimum number of
individuals as defined by count. |
count
|
the minimum number of individuals in each subsample |
tolerance
|
the number of individuals less than count that
constitutes an acceptable subsample |
min.percentage
|
if TRUE, each subsample is at least a minimum percentage as
defined by percentage |
percentage
|
the minimum percentage subsample size |
max.percentage
|
percentage subsample beyond which the subsampling effort
outweighs the effort of sorting the whole sample: therefore, whole
sample taken |
Details
This function simulates a 100-cell box subsampler as described by Marchant (1989). For a fixed-count subsample, it makes a first attempt at subsampling by calculating the number of cells on average to collect the required number. If the number collected is less than the required number (minus the tolerance level), then further one-percent subsamples are taken until the number is exceeded.
Value
a list containing
subsampled.set
|
a data frame of the same structure of x, but with subsampled
counts |
subsample.size
|
a vector of proportional subsample sizes for each column |
number.in.subsample
|
a vector of the total number of individuals in each subsampled
column |
Author(s)
Chris Walsh: Chris.Walsh@sci.monash.edu.au.
References
Marchant, R. (1989) A subsampler for samples of benthic invertebrates. Bulletin of the Australian Society for Limnology 12, 49-52.
Examples
urban <- read.table("urban.txt", header=TRUE)
urban.10perc <- sub.sample(urban[,2:24], fixed.percentage = TRUE,
percentage = 10)
urban.10perc
#Fixed 10 percent subsamples
urban.300count <- sub.sample(urban[,2:24])
urban.300count
#Fixed count subsamples of 300 individuals
urban.300or10 <- sub.sample(urban[,2:24], min.percentage = TRUE)
urban.300or10
#Fixed count of 300 individuals, conditional on subsample
#being at least 10 percent.
|
|
|