Suppose I have these two vectors:
<code>x <- c("a", "b", "c")
y <- c(1, 2, 3, 4)
</code>
<code>x <- c("a", "b", "c")
y <- c(1, 2, 3, 4)
</code>
x <- c("a", "b", "c")
y <- c(1, 2, 3, 4)
Each of them correspond to 1 argument of a function(x, y). I want to run this function with all possible combinations between those two vectors. For example:
<code>function("a", 1)
function("a", 2)
function("a", 3)
function("a", 4)
function("b", 1)
...
function("c", 4)
</code>
<code>function("a", 1)
function("a", 2)
function("a", 3)
function("a", 4)
function("b", 1)
...
function("c", 4)
</code>
function("a", 1)
function("a", 2)
function("a", 3)
function("a", 4)
function("b", 1)
...
function("c", 4)
So I want to run this function 12 times, that is: length(x) * length(y). How do I accomplish this?