Apologees the novice question. Currently climbing up the learning curve of R.

Suppose I have the following function and the data.frame:

testfun<-function(x=1,y=2) x+y

testframe=data.frame(col1=c(1,2),col2=c(3,4))

When evaluating testfun, I want to use the default value for y (which
is 2) and for x, I want to feed (one by one) the values in col2 of
testframe. How can I achieve this please? Not having much success with
apply()

Thanks for any help.

______________________________________________
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