log_or_0: Logarithmic transform

Description Usage Arguments Value Examples

View source: R/svs.r

Description

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

Usage

1
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

1
2
3
4
5
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 Nov. 10, 2020, 1:09 a.m.