Skip to contents

Takes a random sample of size N-1 from the population. See the Details section below for further information.

Usage

leaveOneOutSample(N)

Arguments

N

positive integer value, the population size

Value

A vector of length N-1 containing the index of the computed random set of observations.

Details

The leave-one-out is a particular case of the leave-p-out, where p = 1. A random sample of size 1 is taken from the population and used as holdout data. This function returns a sample of size N-1 obtained by removing the holdout sample from the population.

See also

Author

Alessandro Barberis

Examples

#Set seed for reproducibility
set.seed(seed = 5381L)

#Take one sample leaving out 1 element
leaveOneOutSample(N = 10)
#> [1]  2  3  4  5  6  7  8  9 10