makePartitions: Make the partitions used to run a BEDASSLE cross-validation...

View source: R/model.comparison.R

makePartitionsR Documentation

Make the partitions used to run a BEDASSLE cross-validation analysis

Description

makePartitions makes the partitions used to run a BEDASSLE cross-validation analysis

Usage

makePartitions(prefix, nReplicates = 10, nPartitions = 5, N)

Arguments

prefix

A character object giving the prefix to be attached to the output data partitions object to be used in the k-fold cross-validation procedure.

nReplicates

An integer giving the number of cross-validation replicates to be run. The default value is 10.

nPartitions

An integer giving the number of data folds within each run. The default value is 5.

N

An integer giving the number of samples in the dataset. This should have the same value as nrow(geoDist).

Details

This function initiates a k-fold cross-validation analysis to determine the statistical support for the specified model.

The number of samples N must be divisible by the specified number of partitions (nPartitions).

Value

This function generates and saves a nested list R object (".Robj" file) that can be used to run a cross-validation analysis. This R object is a list of length nReplicates, each element of which is a list of length nPartitions. Each of those nPartitions element is a vector of indices (between 1 and N) of the random subset of individuals assigned to that cross-validation partition. Each of the N individuals appears in exactly one partition per replicate.


gbradburd/bedassle documentation built on May 20, 2022, 1 p.m.