Javatpoint Logo
Javatpoint Logo

R Function Default Arguments

In R, function can have default values of it's parameters. It means while defining a function, it's parameters can be set values. It makes function more generic. For example

# Calling function

Output:

20

# Calling function

Output:

30

First time, function is called with single argument and default value is used for second argument. Function called successfully and produce a result.

Second time, function is called with two arguments, default value of second argument is overridden.





Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA