Learn R Programming

svs (version 3.0.0)

log_or_0: 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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab