Skip to contents

If the length of the input vector is greater than 30, returns a vector of up to 30 values sampled according to the observed frequency of each unique value. Otherwise, returns the vector unchanged.

Usage

AIbinSmooth(baf)

Arguments

baf

Numeric or character vector. Typically a vector of rounded AI (e.g., BAF) values.

Value

A numeric vector, either unchanged (if length <= 30) or of length <= 30, with values sampled according to observed frequencies.

Examples

set.seed(1)
x <- sample(c(0.1, 0.2, 0.3, 0.4), 100, replace = TRUE)
AIbinSmooth(baf = x)
#>  [1] 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.3 0.3
#> [20] 0.3 0.3 0.3 0.3 0.3 0.4 0.4 0.4 0.4 0.4 0.4