meanSmoother: Windowed mean smoother

View source: R/meanSmoother.R

meanSmootherR Documentation

Windowed mean smoother

Description

TODO: farm out to C++ and test, at least when there are no NAs

Usage

meanSmoother(x, k = 1, iter = 2, na.rm = TRUE, delta = 0, w = NULL)

Arguments

x

Input data matrix: samples are columns, regions/loci are rows

k

Number of windows to use (default k=1, i.e., 3 windows)

iter

Number of iterations to smooth (default is 2)

na.rm

Whether to remove NAs prior to smoothing (TRUE)

delta

Convergence threshhold (overrides iter if > 0; default is 0)

w

Weights, if using any (NULL)

Value

 Smoothed data matrix

Examples

dummy <- matrix(rnorm(10000), ncol=25)
smooth.dummy <- meanSmoother(dummy)
smooth.dummy <- meanSmoother(dummy, iter=3) 
smooth.dummy <- meanSmoother(dummy, delta=1e-3) 


biobenkj/compartmentalizer documentation built on Oct. 13, 2023, 5:26 p.m.