I need to paste all combinations of elements from two character vectors, \"each\" to \"each\": instead of
> paste0(c(\"a\", \"b\"), c(\"c\", \"d\")) [1]
This can also be used.
comb <- function(x,y) { x1 <- rep(x, each=length(y)) y1 <- rep(y, times=length(x)) paste0(x1,y1) } comb(2:4, 5:7)