log_or_0: Logarithmic transform

View source: R/svs.r

log_or_0R Documentation

Logarithmic transform

Description

A function for computing the logarithm of every entry in a table with 0 for zero entries.

Usage

log_or_0(x, base = exp(1))

Arguments

x

A table or a (sparse) matrix.

base

Numeric specification of the base with respect to which logarithms are computed.

Value

An array with the logarithm of every entry and 0 for all zero entries.

Examples

SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
   header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8",
   stringsAsFactors = FALSE)
tab_SndT_Fra <- table(SndT_Fra)
log_or_0(tab_SndT_Fra)

svs documentation built on June 24, 2024, 5:07 p.m.