Concatenation of permutations
c.Rd
Concatenate words or cycles together
Usage
# S3 method for class 'word'
c(...)
# S3 method for class 'cycle'
c(...)
# S3 method for class 'permutation'
rep(x, ...)
Arguments
- ...
In the methods for
c()
, objects to be concatenated. Must all be of the same type: either allword
, or allcycle
- x
In the method for
rep()
, a permutation object
Note
The methods for c()
do not attempt to detect which type (word or
cycle) you want as conversion is expensive.
Function rep.permutation()
behaves like base::rep()
and
takes the same arguments, eg times
and each
.
Examples
x <- as.cycle(1:5)
y <- cycle(list(list(1:4,8:9),list(1:2)))
# concatenate cycles:
c(x,y)
#> [1] (12345) (1234)(89) (12)
# concatenate words:
c(rperm(5,3),rperm(6,9)) # size adjusted to maximum size of args
#> [1] () (13) (23) (13)
#> [5] (23) (1732596) (12349)(5678) (18593)(24)(67)
#> [9] (156298)(347) (184927)(365) (12467385)
#> [coerced from word form]
# repeat words:
rep(x, times=3)
#> [1] (12345) (12345) (12345)