Hi all, suppose I have following user defined function:

 

fn1 = function(x, y, ...) {

                                z <- x+y; u=y^2

                                # if something with name "add" exists in the
function argument then do some calculation and return that calculated value,
NOT z

                                # if NOT then return z

                                return(z)

                }

 

As you see in the function definition, I put open space " '.' syntax " , so
that user can put additional argument. However here what I want to do is, if
user have additional input then above function would do some ***special
calculation*** and return that value.

 

How can I accomplice that?

 

Thanks and regards,


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to