getGroupCVFoldIDs: Given a vector of group IDs 'groups', returns a vector where...

View source: R/utilities.R

getGroupCVFoldIDsR Documentation

Given a vector of group IDs 'groups', returns a vector where each element is an integer representing the fold the corresponding element in 'groups' is assigned to. Elements with the same group ID will always be assigned to the same fold.

Description

Given a vector of group IDs 'groups', returns a vector where each element is an integer representing the fold the corresponding element in 'groups' is assigned to. Elements with the same group ID will always be assigned to the same fold.

Usage

getGroupCVFoldIDs(groups, nFolds, seed = NULL)

Arguments

groups

A vector of group IDs.

nFolds

An integer representing the number of folds.

seed

An integer to use as the random seed.

Value

A list containing foldIDs, groupToFoldMap and foldToNElementsMap.


marioni-group/MethylPipeR documentation built on Oct. 10, 2024, 3:32 p.m.