Description Usage Arguments Value
View source: R/sample_data_functions.r
The number and names of classes can be freely chosen. The elements in 'class_labels' need to be one less compared to the elements in 'my_breaks'. Metrics will be calculated for each of the classes.
1 | categorize(response_data, my_breaks, class_labels)
|
response_data |
a data frame where the columns are the continuous response variables |
my_breaks |
the intervals for the binning, specified as e.g. 'c(-Inf, 2, 4, 6, Inf)' |
class_labels |
desired names of the factor levels, Specified as e.g. 'c("Below2", "2to4", "4to6", "Above6")' for breaks 'c(-Inf, 2, 4, 6, Inf)' or 'c("Negative", "Positive")' for breaks 'c(-Inf, 0, Inf)'. At least one value needs to be a character, the others are then coerced to class character |
A data frame with factor columns containing the categorized response variables
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.