Learn R Programming

VIM (version 5.1.1)

sampleCat: Random aggregation function for a factor variable

Description

The function sampleCat samples with probabilites corresponding to the occurrence of the level in the NNs.

Usage

sampleCat(x, weights = NULL)

Arguments

x

factor vector

weights

numeric vector providing weights for the observations in x