don't ask if my example is reasonable, maybe there are examples how to circumvent my question, but maybe it is not possible to pass more than one parameters to an anonymous function that should be applied groupwise to a data.frame

I have a data.frame

```
w <- c("A", "B")
x <- c(1,2)
y <- c(3,4)

df <- data.frame(w,x,y)

```

Now I want to apply a function to each group (defined by column w) that creates column z by multiplying the columns x and y like

df$z <- ...(list(df$x, df$y), df$w, FUN=function(x,y) {x \* y}

Actually, I'm not asking for a concrete answer for the multiplication, I'm asking for the syntax how to apply two or more parameters to an anonymous function.

I changed the example due to the correct comment from Joshua, that tapply will not work with a list.

Any hints appreciated

Tom