Learn R Programming

liver (version 1.5)

partition: Partition the data

Description

Randomly partitions the data (primarly intended to split into "training" and "test" sets) according to the supplied probabilities.

Usage

partition( data, prob = c( 0.7, 0.3 ) )

Arguments

data

an (\(n \times p\)) matrix or a data.frame.

prob

a numerical vector in [0, 1].

Value

a list which includes the data partitions.

Examples

Run this code
# NOT RUN {
data( iris )

partition( data = iris, prob = c( 0.7, 0.3 ) )
# }

Run the code above in your browser using DataLab