Generate a factor with custom levels and repetitions.
Usage
fct_generator(labels, nlevels)
Value
A factor with custom levels and repetitions.
Arguments
labels
A character vector specifying the custom labels for the factor levels.
nlevels
An integer or a vector of integers indicating the number of repetitions for each label.
If a single integer is provided, it is recycled to match the length of labels.
If a vector is provided, it should have the same length as labels.
Details
This function creates a factor with custom labels and specified repetitions for each label.