Learn R Programming

aroma.light (version 3.2.0)

normalizeAverage: Rescales channel vectors to get the same average

Description

Rescales channel vectors to get the same average.

Usage

"normalizeAverage"(x, baseline=1, avg=stats::median, targetAvg=2200, ...) "normalizeAverage"(x, baseline=1, avg=stats::median, targetAvg=2200, ...)

Arguments

x
A numeric NxK matrix (or list of length K).
baseline
An integer in [1,K] specifying which channel should be the baseline.
avg
A function for calculating the average of one channel.
targetAvg
The average that each channel should have afterwards. If NULL, the baseline column sets the target average.
...
Additional arguments passed to the avg function.

Value

Returns a normalized numeric NxK matrix (or list of length K).