**Navigate this page**hide

**ln()** function is used to calculate a natural logarithm. The natural logarithm is the logarithm to the base of the number e. It is used in solving time and growth problems. This guide will show how to use the **ln()** function in R.

## ln() Function Syntax

`ln(x)`

Where **x** is a numeric or complex vector.

## Installing the SciViewsPackage

ln() comes from the **SciViews** package. To install and load the package, run the following code:

```
install.packages('SciViews')
library('SciViews')
```

### Example

```
library('SciViews')
#calculating natural log of 5
ln(5)
```

#### Output

`[1] 1.609438`