keepcyc(rgivenshape(10,2:8),function(x){length(x) == 2}) # retains just transpositions
keepcyc(megaminx,function(x){any(x == 100)}) # retains just cycles modifying facet #100
keepcyc(rperm(100),function(x){max(x)-min(x) < 3}) # retains just cycles with range<3
f <- function(x,p){all(xp)} # keep only cycles with all entries either
keepcyc(rgivenshape(9,rep(2:3,9)),f,p=20) # all < 20 or all >20
Run the code above in your browser using DataLab