log R Documentation

## Logarithms and Exponentials

### Description

`log` computes logarithms, by default natural logarithms, `log10` computes common (i.e., base 10) logarithms, and `log2` computes binary (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with `base`.

### Usage

```## S4 method for signature 'fm'
log10(x)

## S4 method for signature 'fmV'
log10(x)

## S4 method for signature 'fm'
log2(x)

## S4 method for signature 'fmV'
log2(x)

## S4 method for signature 'fm'
exp(x)

## S4 method for signature 'fmV'
exp(x)

## S4 method for signature 'fm'
log(x, base = exp(1))

## S4 method for signature 'fmV'
log(x, base = exp(1))
```

### Arguments

 `x` a numeric vector. `base` a positive number.

### Details

`exp` computes the exponential function.

### Value

A vector of the same length as `x` containing the transformed values. `log(0)` gives `-Inf`, and `log(x)` for negative values of `x` is `NaN`. `exp(-Inf)` is 0.

### Examples

```mat <- log(fm.runif.matrix(100, 10))
mat <- log10(fm.runif.matrix(100, 10))
mat <- log2(fm.runif.matrix(100, 10))
mat <- exp(fm.runif.matrix(100, 10))
```