View source: R/tcgaretriever_v_1_7.R
make_groups | R Documentation |
Assign each element of a numeric vector to a group. Grouping is based on ranks: numeric values are sorted and then split in 2 or more groups. Values may be sorted in an increasing or decreasing fashion. The vector is returned in the original order. Labels may be assigned to each groug.
make_groups(num_vector, groups, group_labels = NULL, desc = FALSE)
num_vector |
numeric vector. It includes the values to be assigned to the different groups |
groups |
integer. The number of groups that will be generated |
group_labels |
character vector. Labels for each group. Note that the length of group_labels has to be equal to the number of groups |
desc |
logical. If TRUE, the sorting is applied in a decreasing fashion |
data.frame including the vector provided as argument in the original order ("value") and the grouping vector ("rank"). If labels are provided as an argument, group labels are also included in the data.frame ("labels").
Damiano Fantini, damiano.fantini@gmail.com
https://www.data-pulse.com/dev_site/TCGAretriever/
exprs_geneX <- c(19.1,18.4,22.4,15.5,20.2,17.4,9.4,12.4,31.2,33.2,18.4,22.1)
groups_num <- 3
groups_labels <- c("high", "med", "low")
make_groups(exprs_geneX, groups_num, groups_labels, desc = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.