kfold_partition: K-Fold Partition

Description Usage Arguments Value

View source: R/kfold_partition.R

Description

Randomly partition sites into groups for cross-validation. Sites are randomly partitioned into K groups that are roughly similar in size (i.e., number of observations). If multiple permutations are requested, kfold_partition returns the one with the smallest range of group sizes.

Usage

1
kfold_partition(psm_dat, K, N_random = 1000)

Arguments

psm_dat

A data frame with a column of class factor named site.

K

A positive integer giving the number of groups.

N_random

A natural number giving the number of random permutations to compare.

Value

A named list with components

N_group

A vector of group sizes.

group

A vector giving the group membership of each row in psm_dat.


ebuhle/SEMPSM documentation built on Aug. 8, 2020, 4:05 a.m.