I have a function like this dummy-one:
FUN <- function(x, parameter){ if (parameter == 1){ z <- DO SOMETHING WITH \"x\"} if (parameter ==2){
You want apply(data,1,FUN,parameter=1). Note the ... in the function definition:
apply(data,1,FUN,parameter=1)
...
> args(apply) function (X, MARGIN, FUN, ...) NULL
and the corresponding entry in the documentation:
...: optional arguments to ‘FUN’.