fct_generator | R Documentation |
Generate a factor with custom levels and repetitions.
fct_generator(labels, nlevels)
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 |
This function creates a factor with custom labels and specified repetitions for each label.
A factor with custom levels and repetitions.
# Example usage of the function
fct_generator(labels = c("A", "B", "C"), nlevels = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.