Hi,
You could use:
as.matrix(expand.grid(vec1x3,vec1x3))
#or
as.matrix(expand.grid(rep(list(vec1x3),2)))
#or
library(gtools)
permutations(3, 2, vec1x3, repeats.allowed=TRUE)
A.K.
On Tuesday, October 15, 2013 7:14 PM, Stock Beaver
wrote:
# I understand that a good way to build a vector fro
On 10/15/2013 07:11 PM, Stock Beaver wrote:
# I understand that a good way to build a vector from a sequence of integers,
# is to use syntax like this:
myvec = c(1:99)
First, the c() is not needed here.
myvec <- 1:99
works just fine.
# Here is the 'short' version of my question:
# I want t
# I understand that a good way to build a vector from a sequence of integers,
# is to use syntax like this:
myvec = c(1:99)
# Here is the 'short' version of my question:
# I want to understand a 'good' way to build a matrix from a sequence of
integers.
# If that question is not clear, here is a
3 matches
Mail list logo