Okay, what about this:

## use expand.grid() to create a data frame of all combinations
## of the element numbers of zz and tt
index <- expand.grid(seq_along(zz), seq_along(tt))
index

## use the index to select the element of zz and tt and find their product
mapply(`*`, zz[index[, 1]], tt[index[, 2]])

HTH,

Josh

On Mon, Jun 13, 2011 at 7:12 AM, Carla Moreira <[email protected]> wrote:
> Thank you very much.
>
> I want each element of zz by each element of tt (i.e., every
> possible 2-way combination).
>
>
> Carla



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to