We need functions to avoid the repetitive same few lines of code.
R functions are treated much like any other R objects.
function arguments are another important option for a function.
We can modify our code a bit by setting a default value for the arguments. Therefore we can call the function without passing any argument value to the interface.
Function arguments are evaluated lazily. The below code example clearly explains it.
When both arguments are used in the body then R will check for the next argument too.
Arguments with ‘…’
In R we can find a special argument … , which indicate a number of arguments that are usually passed on to other functions. The … argument is often used when extending another function.