genIntervals: Generate intervals for local statistics

View source: R/genIntervals.R

genIntervalsR Documentation

Generate intervals for local statistics

Description

Generate intervals for local statistics

Usage

genIntervals(
  X,
  nBin = 20,
  slide = FALSE,
  equiPop = TRUE,
  popMin = 30,
  logBin = TRUE
)

Arguments

X

(integer or vector) if integer: size of set to partition, if vector: ordered set of values to bin

nBin

(integer) number of contiguous intervals

slide

(logical) generate contiguous intervals (default 'slide = FALSE') or generate intervals from a sliding window

equiPop

(logical) generate intervals with equal bin counts (default: 'equiPop = TRUE')

popMin

(integer) minimal bin count in an interval

logBin

(logical) if 'equiPop = FALSE', one can choose between equal range intervals, or equal log-range intervals (default 'logBin = TRUE')

Value

A list with 'nbr' the number of intervals, 'lwindx' and 'upindx', vectors of indices for the first and last point of each interval 'pop' a vector of bin counts, 'msg' an error message and the configuration parameters: 'slide', 'equiPop', 'popMin' and 'logBin'

Examples


  uE  = sqrt(rchisq(1000, df = 4))  # Re-scale uncertainty
  int = genIntervals(uE,20) # Generate 20 bins with equal counts


ppernot/ErrViewLib documentation built on June 1, 2024, 4:33 a.m.