I have a function like this dummy-one:
FUN <- function(x, parameter){ if (parameter == 1){ z <- DO SOMETHING WITH \"x\"} if (parameter ==2){
You can make an anonymous function within the call to apply so that FUN will know what "x" is:
apply
apply(data, 1, function(x) FUN(x, parameter = 1))
See ?apply for examples at the bottom that use this method.
?apply