cut_dataset: Randoming and sampling a dataset by its row numbers

View source: R/cut.dataset.R

cut_datasetR Documentation

Randoming and sampling a dataset by its row numbers

Description

This function chooses the rows of a dataset to be included in the train, test (optional) and validation (optional) datasets according to proportions specified by the user.

Usage

cut_dataset(n, proportions, test = TRUE, validation = TRUE)

Arguments

n

The total number of rows to sample from.

proportions

The list of the (2) proportions wanted for test and validation set. Only the first is used when there is only one of either test or validation that is set to TRUE. Produces an error when the sum is greater to one. Useless if both test and validation are set to FALSE. Default: list(0.2,0.2).

test

TRUE if a test dataset is wanted, FALSE otherwise (default=TRUE).

validation

TRUE if a test dataset is wanted, FALSE otherwise (default=TRUE).

Author(s)

Adrien Ehrhardt


adimajo/scoring documentation built on March 7, 2024, 11:18 p.m.