combinations(3,2,letters[1:3])
combinations(3,2,c(1:3),repeats=TRUE)
combinations(6,3,1:6,repeats=TRUE)
# To use large 'n', you need to change the default recusion limit
options(expressions=1e5)
cmat <- combinations(100,2)
dim(cmat) # 4950 by 2
Run the code above in your browser using DataLab