Learn R Programming

KODAMA (version 0.0.1)

kfold: k-Fold Partitioning

Description

This function computes the k-fold partitioning of a vector. Each record in a vector is randomly assigned to a group. Group numbers are between 1 and k.

Usage

kfold(constrain,k=10)

Arguments

constrain
a vector of labels.
k
number of groups.

Value

A vector with group assignmnets.

Examples

Run this code
kfold(1:100, k=10)  	
kfold(rep(1:20,each=5), k=10)

Run the code above in your browser using DataLab