balanceset: Balance samples

Description Usage Arguments Details

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

Description

Balance samples

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

Usage

1
2
3

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 April 1, 2020, 4:42 a.m.