Open In App

Compute the Hyperbolic arctangent of numeric data in R Programming – atanh() Function

Improve
Improve
Like Article
Like
Save
Share
Report

atanh() function in R Language is used to compute the hyperbolic arctangent of numeric data.

Syntax: atanh(x)

Parameters:
x: Numeric value, array or vector.

Example 1:




# R program to illustrate
# atanh function
   
# Calling atanh() function over
# different numbers
atanh(0)
atanh(1)
atanh(0.9)
atanh(-0.8)


Output:

[1] 0
[1] Inf
[1] 1.472219
[1] -1.098612

Example 2:




# R program to illustrate
# atanh function
  
# Initializing some vectors
x <- c(0, 1, 0.9)
y <- c(-0.1, 0.1)
   
# Calling atanh() function
atanh(x)
atanh(y)


Output:

[1] 0.000000      Inf 1.472219
[1] -0.1003353  0.1003353

Last Updated : 08 Jun, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads