Skip to contents

Interconvert log ratio and fold change values

Usage

foldChangeToLogRatio(object, ...)

logRatioToFoldChange(object, ...)

# S4 method for numeric
foldChangeToLogRatio(object, base = 2L)

# S4 method for numeric
logRatioToFoldChange(object, base = 2L)

Arguments

object

Object.

base

integer(1). Logarithm base.

...

Additional arguments.

Value

numeric.

Note

Updated 2021-10-14.

Examples

## Convert fold change to log ratio.
foldChangeToLogRatio(c(-8, -4, -2, 1, 2, 4, 8))
#> [1] -3 -2 -1  0  1  2  3

## Convert log ratio to fold change.
logRatioToFoldChange(seq(-3, 3, 1))
#> [1] -8 -4 -2  1  2  4  8