Skip to content
Related Articles

Related Articles

Compute the beta value of Non-Negative Numeric Vectors in R Programming – beta() Function
  • Last Updated : 08 Jun, 2020

beta() function in R Language is used to return the beta value computed using the beta function. The beta function is also known as Euler’s integral of the first kind.

Syntax: beta(a, b)

Parameters:
a, b: non-negative numeric vectors

Example 1:




# R program to illustrate
# beta function
  
# Calling the beta() function
beta(1, 2)
beta(2, 2)
beta(3, 5)

Output:

[1] 0.5
[1] 0.1666667
[1] 0.00952381

Example 2:




# R program to illustrate
# beta function
  
# Initializing some vectors
x <- c(1, 2, 3)
y <- c(2, 4, 6)
  
# Calling the beta() function
beta(x, y)

Output:

[1] 0.500000000 0.050000000 0.005952381
My Personal Notes arrow_drop_up
Recommended Articles
Page :