categorize: Categorize continuous values into classes.

Description Usage Arguments Value

View source: R/sample_data_functions.r

Description

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.

Usage

1
categorize(response_data, my_breaks, class_labels)

Arguments

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

Value

A data frame with factor columns containing the categorized response variables


RJ333/phyloseq2ML documentation built on June 2, 2020, 9:25 p.m.