basics of R Language

Function in R Language

Function in R Language

In R language, we can call a function by typing its name followed by one or more parameters in the parenthesis of that function.

Let’s see the example of SUM function.

Function in R Language


Function to repeat values: rep function

To repeat some values, we will call the rep function and provide its times arguments.

Let’s see an example to repeat “Yo ho!” for three times.

Function in R Language


To get Square root of a number: Sqrt function

To get square root of any number, we will use sqrt() function.

Let’s see an example to get the square root of 16.

Function in R Language


Help

Help(func_name) is used to get the help for the given function.

Let’s see the example to display the help for function sum.

Function in R Language

 

example(func_name) is used to see the examples of usage for the given function.


Lets see the example of min() function.

Function in R Language

Enter

Function in R Language

Let’s see the help for rep() function:

Function in R Language

In next tutorial, we will read about Files in R Language….

Leave a Reply