Skip to content | Change text size
WSC home Commercial analytical services About the WSC Strategic research Contract research Knowledge exchange Postgraduate students WSC publications Staff section Links Contact us
 

Repeated fixed number subsampler without replacement

ssN.nr {sub.sample}

Usage

ssN.nr(x, N, num.ss = 10, spp.names = NULL)

Arguments

x

a vector of integers, corresponding to counts of species

N

Number of individuals to be in subsamples

num.ss

Number of subsamples

spp.names

a vector of the same length as x. If spp.names = NULL, they will be reported as numbers.

Details

This function randomly selects N individuals from a vector and returns a matrix of subsampled species counts with species in rows and the num.ss subsamples in columns. Note that N*num.ss cannot exceed the total number of individuals in x (sum(x)).

Value

ss.x

a data frame of subsampled counts, with species in rows and subsamples in columns

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

#10 subsamples of 100 individuals from a sample of invertebrate
#samples
urban <- read.table("urban.txt", header=TRUE)
urban8.100 <- ssN.nr(urban[,8],100, num.ss = 10, spp.names = urban[,1])
urban8.100