Learn R Programming

sperich (version 1.5-9)

generate.subsamples: Subsample Creation

Description

A function that creates an array of subsamples of a dataset.

Usage

generate.subsamples(number.of.occurrences, fold, loocv.limit)

Value

This function returns a grid which contains the subsamples.

Arguments

number.of.occurrences

The number of occurrences of the species.

fold

The number of groups which should be created if the number of occurrences is greater than loocv.limit.

loocv.limit

The limit below which the subsamples are created for a leave-one-out-cross-validation instead of a k-fold-cross-validation.

Author

Maximilian Lange, Sven Lautenbach

Details

This routine creates subsamples of species occurrences based on the number of occurrences of the chosen species and the number of groups which should be created. If the number of occurrences of the chosen species is below the loocv.limit, the groups contain only one member and the fold value will be ignored. The subsamples can be used for a k-fold or leave-one-out-cross-validation.

Examples

Run this code
subsamples <- generate.subsamples(15,3,5)

Run the code above in your browser using DataLab