Learn R Programming

rkeops (version 2.2.2)

log: Element-wise natural logarithm operation

Description

Symbolic element-wise natural logarithm operation for LazyTensor objects or default element-wise natural logarithm operation otherwise, i.e. \(\log(x)\).

Usage

log(x, base = exp(1))

Value

See value of log.default() or log.LazyTensor().

Arguments

x

input for log.default() or log.LazyTensor().

base

numeric, see log.default(), not used with LazyTensor input.

Author

Chloe Serre-Combe, Amelie Vernay

Details

If x is a LazyTensor, see log.LazyTensor(), else see log.default().

See Also

log.default(), log.LazyTensor()

Examples

Run this code
if (FALSE) {
# R base operation
log(1)
log(1:10)
# LazyTensor symbolic element-wise natural logarithm
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'
Log_x <- log(x_i)                   # symbolic matrix, 150 rows and 3 columns
}

Run the code above in your browser using DataLab