splitGroupByCutoff | R Documentation |
Split group by various methods. Useful
splitGroupByCutoff(
group = NULL,
values = NULL,
fun = NULL,
quantile.cutoff = NULL,
sample.names = NULL,
cut.point = NULL,
cut.label = NULL,
specific.group = NULL,
group.prefix = NULL
)
fun |
e.g. mean, median |
quantile.cutoff |
0-1. percent value for quantile function |
sample.names |
Default NA |
cut.point |
Default NULL. Not include the minimum and maximum value |
cut.label |
length should be the length(quantile.cutoff), or length(cut.point) plus 1 |
specific.group |
If specified, only split within these group |
group.prefix |
"" |
set.seed(111)
value = runif(100, min=0, max=100)
set.seed(111)
group = sample(c(1,2,3),100, replace = TRUE)
table(group)
res <- loonR::splitGroupByCutoff(group, value, fun="mean", cut.label = c("L","H"), group.prefix = "G", specific.group = c(1,2))
table(res$New.Label)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.