Learn R Programming

extlasso (version 0.3)

kfold: k-fold partition of data at random

Description

The function partitions a data set into k folds of equal sizes at random.

Usage

kfold(data1,k)

Arguments

data1

A matrix.

k

Number of folds

Value

A matrix with fold identification in first column.

Details

This function is internal and used by cross validation routines.

Examples

Run this code
# NOT RUN {
data=matrix(rnorm(10*4),10,4)
kfold(data,3)
# }

Run the code above in your browser using DataLab