I have three or more independent variables represented as R vectors, like so:
A <- c(1,2,3)
B <- factor(c(\'x\',\'y\'))
C <- c(0.1,0.5)
Here's a way to do both, using Ramnath's suggestion of expand.grid:
f <- function(x,y,z) paste(x,y,z,sep="+")
d <- expand.grid(x=A, y=B, z=C)
d$D <- do.call(f, d)
Note that do.call works on d "as-is" because a data.frame is a list. But do.call expects the column names of d to match the argument names of f.