log_byname: Logarithm of matrix elements

View source: R/Unary.R

log_bynameR Documentation

Logarithm of matrix elements

Description

Specify the base of the log with base argument.

Usage

log_byname(a, base = exp(1))

Arguments

a

a matrix or list of matrices

base

the base of the logarithm (default is exp(1), giving the natural logarithm)

Value

M with each element replaced by its base base logarithm

Examples

log_byname(exp(1))
m <- matrix(c(10,1,1,100), nrow = 2, dimnames = list(paste0("i", 1:2), paste0("c", 1:2))) %>%
  setrowtype("Industry") %>% setcoltype("Commodity")
log_byname(m)
log_byname(m, base = 10)

matsbyname documentation built on April 2, 2022, 1:06 a.m.