cross | R Documentation |
This operation is useful in recursively generating all the possible path histories of a sequential design.
cross(A, v)
A |
An arbitrary matrix |
v |
An arbitrary vector |
For each component of v, the matrix A is duplicated with an extra right column equal to v[i]. This is added to the current output until the components of v are exhausted.
A matrix with dim(A)[2]+1 columns and dim(A)[1]*length(v) rows.
Chris J. Lloyd
A=cbind(c(1,2),c(3,4)) v=c(5,6) cross(A,v) # [,1] [,2] [,3] #[1,] 1 3 5 #[2,] 2 4 5 #[3,] 1 3 6 #[4,] 2 4 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.