applyScale: Apply a scale

View source: R/applyScale.R

applyScaleR Documentation

Apply a scale

Description

Applies a scale to a vector of channel values

Usage

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

## Not run: 
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))

## End(Not run)

primitybio/cellengine-r-toolkit documentation built on Oct. 19, 2024, 1:17 a.m.