splitGroupByCutoff: Split group by various methods. Useful

View source: R/Common.R

splitGroupByCutoffR Documentation

Split group by various methods. Useful

Description

Split group by various methods. Useful

Usage

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
)

Arguments

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

""

Examples

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)

ProfessionalFarmer/loonR documentation built on Oct. 9, 2024, 9:56 p.m.