Compute the beta value of Non-Negative Numeric Vectors in R Programming – beta() Function

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

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

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# 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)

chevron_right


Output:

[1] 0.500000000 0.050000000 0.005952381
My Personal Notes arrow_drop_up

Recommended Posts:


Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.