[R] partial evaluation of a function with several arguments

Martin Spindler Martin.Spindler at gmx.de
Tue Feb 8 05:33:23 CET 2011


Dear all,

I have the following problem:

add <- function(x,y) {x+y}

What is the easiest / most elegant way to create a new function (e.g. with the name "addev") that sets the second argument of the function "add" to a fixed value (e.g. y=3), i.e. addev <- add(x,3). But this does not work.

Thank you for your efforts in advance!

Best,

Martin
-- 




-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



More information about the R-help mailing list