One possibility is to use something like the following:
a1 <- matrix(1:4, 2, 2)
a2 <- c(8, 9)
cbind(a1[rep(1:nrow(a1), length(a2)), ], rep(a2, each = nrow(a1)))
I hope it helps.
Best,
Dimitris
On 3/15/2012 1:33 PM, eugen pircalabelu wrote:
Hello R-users,
I have the following question, fo
Hello R-users,
I have the following question, for which my search did not really return any
usable result.
If I have a matrix a1, and a vector a2 like below
a1<-matrix(c(1:4),2,2)
a2<-c(8,9)
is there any function like the expand.grid (or some clever calling of the
function) such that it
2 matches
Mail list logo