balanceset: Balance samples

View source: R/rf.R View source: R/balanceset.R

balancesetR Documentation

Balance samples

Description

Balance samples

given a factor, sample the overrepresented groups such that each factor level is represented the same number of times

Usage

balanceset(x)

balanceset(x)

Arguments

x

a factor

n

optionally, how many samples should be in each group

replace

whether sampling with replacement

x

a vector

Details

Given a factor, sample the overrepresented groups such that each factor level is represented the same number of times. The function counts the number of occurences of the factor levels, and resamples each group with number of occurences higher than minimal.


january3/myfuncs documentation built on Jan. 16, 2025, 8:37 p.m.