Learn R Programming

BioMark (version 0.4.5)

get.segments: Subsampling segments

Description

Provides combinations of samples to be left out in subsampling, with a maximum given by parameter max.seg.

Usage

get.segments(i1, i2 = NULL, oob.size = 1, max.seg = 100)

Arguments

i1
either an index vector for objects in class 1, or a classification vector (factor, or numeric), from which the indices of both classes can be derived.
i2
if non-NULL, vector indexing objects in class 2.
oob.size
number of samples to be left out in every iteration. If one (the default), this corresponds to LOO subsampling.
max.seg
maximal number of segments to return. If null, all possible combinations are returned -- this option is only possible if oob.size equals 1. If oob.size is larger, max.seg must be defined since the number of possibilities becomes too large for even very small numbers of objects.

Value

Returns a matrix where the columns contain the numbers of the samples to be left out in the respective iterations.

See Also

get.biom

Examples

Run this code
i1 <- seq(1, 10, by = 2)
i2 <- seq(2, 15, by = 2)
get.segments(i1, i2)
get.segments(i1, i2, max.seg = 10)
get.segments(i1, i2, oob.size = 2, max.seg = 10)

I <- rep(1:2, c(5,6))
get.segments(I)
get.segments(I, max.seg = 15)

Run the code above in your browser using DataLab