Applies a scale to a vector of channel values

applyScale(scale, data, clampQ = FALSE)

Arguments

scale

Scale (named list with keys "type", "maximum", "minimum", and "cofactor").

data

Vector of values for a channel.

clampQ

If true, values will be clamped to fall within the scale's minimum and maximum.

Examples

if (FALSE) { # \dontrun{
applyScale(list(type = "LinearScale", minimum = 1, maximum = 10), c(1, 2, 3, 4, 5))

# Using a Scale from a CellEngine ScaleSet
scaleSet <- getScaleSets(experimentId)
chanIdx <- 5
applyScale(scaleSet$scales[[1]][chanIdx, "scale"], c(1, 2, 3, 4, 5))
} # }