Posted on 29th April 2025|72 views
Will R ignore the unused arguments?
in R is it possible to ignore the unused arguments, for example, I have a module add(x,y) which returns the sum of x and y but the code is.
add(x=10, y=30, c=5)
It returns an error.
Posted on 29th April 2025| views
To avoid the error you can simply add dots in the function definition just like this:
add <- function(x, y, ...){
cat(x,y) }
myfun(x=4,y=7,hello=3)