On Dec 18, 2009, at 6:27 PM, Raymond Danner wrote:
Dear R community,
I am trying to create a matrix of permutations of a vector:
bands <- c("AL", "B", "DB", "DG", "G", "K", "LB", "LG", "MG", "O",
"P",
"PI", "PK", "PU", "R", "V", "W", "Y")
Each permutation must be 4 characters long. permuta
Hi Ray,
First possibility: just select those combinations that contain "AL":
combos.with.AL <- possible.combos[rowSums(possible.combos=="AL")>0,]
Second possibility: create all 3-combos *without* "AL":
bands.without.AL <- c("B", "DB", "DG", "G", "K", "LB", "LG", "MG", "O",
"P", "PI", "PK", "PU"
Dear R community,
I am trying to create a matrix of permutations of a vector:
bands <- c("AL", "B", "DB", "DG", "G", "K", "LB", "LG", "MG", "O", "P",
"PI", "PK", "PU", "R", "V", "W", "Y")
Each permutation must be 4 characters long. permutations() from the gtools
package does this easy enough:
pos
3 matches
Mail list logo