log_transform: Log-transforms a numeric object

Description Usage Arguments Value Functions Author(s)

View source: R/preprocess.R

Description

Performs log transformation on a numeric object. The data can be scaled first if requested by dividing X by the provided scaling factor.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
log_transform(
  x,
  log_base = 2,
  scaling_factor = 1,
  pseudo_count = 1,
  verbose = FALSE
)

reverse_log_transform(
  x,
  log_base = 2,
  scaling_factor = 1,
  pseudo_count = 1,
  verbose = FALSE
)

Arguments

x

a numeric object (i.e. vector or matrix)

log_base

a positive number representing the base with respect to which the logarithm will be computed. Default is 2

scaling_factor

a positive number by which the data will be scaled, i.e. divided prior to log computation. Default is 1, i.e. no scaling

pseudo_count

a positive number which will be added to the possibly scaled x prior to log computation to avoid taking the logarithm of zero. Default is 1

verbose

suppresses all messages from this function. Default is FALSE.

Value

A log-transformed numeric object.

Functions

Author(s)

Avishay Spitzer


dravishays/scandal documentation built on Jan. 8, 2020, 1:30 p.m.