Skip to content
Prev 311680 / 398503 Next

Adding a function with default parameters into the Rcmdr menu

Le vendredi 23 novembre 2012 ? 03:17 +0100, vincent guyader a ?crit :
I'm not sure how it's supposed to work in Rcmdr, but a very simple
workaround is to call from the menus a custom function defined like
this:
doMyfunction <- function() myfunction()

Another solution is to add "..." before "var" in the arguments list of
your function. That way, the first argument passed by Rcmdr will not
incorrectly be matched to "var".
myfunction <- function(..., var="314"){
    print("hello")
    print(var)
}


My two cents