fct_generator {edibble} | R Documentation |
Factor name generator
Description
Generate a factor with custom levels and repetitions.
Usage
fct_generator(labels, nlevels)
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 |
Details
This function creates a factor with custom labels and specified repetitions for each label.
Value
A factor with custom levels and repetitions.
Examples
# Example usage of the function
fct_generator(labels = c("A", "B", "C"), nlevels = 3)
[Package edibble version 1.1.1 Index]