R Tutorial R Charts & Graphs R Statistics R References

R - asinh() Function



The R asinh() function returns inverse hyperbolic sine of a value. The inverse hyperbolic sine of x is defined as:

asinh

where e is an Euler's number.

In special cases it returns the following:

  • If the argument is NaN, then the result is NaN.
  • If the argument is infinite, then the result is infinity with same sign.

Syntax

asinh(x)

Parameters

x Required. Specify column to compute on.

Return Value

Returns the inverse hyperbolic sine of the value.

Example:

In the example below, asinh() function is used to find out the inverse hyperbolic sine of the value.

#operating on single element atomic vector
print(asinh(-5))
print(asinh(0))
print(asinh(5))

cat("\nOperating on vector\n")
#operating on vector
v <- c(-5, 0, 5)
print(asinh(v))

cat("\nOperating on matrix\n")
#operating on matrix
m <- matrix(c(-5, 0, 5, 7, 10, NaN), nrow=2)
print(asinh(m))

cat("\nOperating on first column of matrix\n")
#operating on first column of matrix
print(asinh(m[,1]))

The output of the above code will be:

[1] -2.312438
[1] 0
[1] 2.312438

Operating on vector
[1] -2.312438  0.000000  2.312438

Operating on matrix
          [,1]     [,2]     [,3]
[1,] -2.312438 2.312438 2.998223
[2,]  0.000000 2.644121      NaN

Operating on first column of matrix
[1] -2.312438  0.000000

❮ R Math Functions