getDiscretizedBins: Find Bin Ranges for a Continuous Variable

View source: R/utils-numeric.R

getDiscretizedBinsR Documentation

Find Bin Ranges for a Continuous Variable

Description

This function will find bin start, end and labels for a continuous variable. Optionally, it can return a value/ count per bin. By default returns 10 bins for equalRanges and quantile methods and 6 for sd (standard deviations).

Usage

getDiscretizedBins(
  x,
  method = c("equalInterval", "quantile", "sd"),
  numBins = NULL,
  getValue = c(TRUE, FALSE)
)

Arguments

x

Numeric (or Date) vector to find bins for

method

A string indicating which method to use to find bins ('equalRanges', 'quantile', 'sd')

numBins

A number indicating how many bins are desired

getValue

A boolean indicating whether to return the counts per bin


VEuPathDB/veupathUtils documentation built on Feb. 8, 2025, 12:29 p.m.