Creating new bit or bitwhich by recycling such vectors

# S3 method for class 'bit'
rep(x, times = 1L, length.out = NA, ...)

# S3 method for class 'bitwhich'
rep(x, times = 1L, length.out = NA, ...)

Arguments

x

bit or bitwhich object

times

number of replications

length.out

final length of replicated vector (dominates times)

...

not used

Value

An object of class 'bit' or 'bitwhich'

See also

Author

Jens Oehlschlägel

Examples


 rep(as.bit(c(FALSE, TRUE)), 2)
#> bit length=4 occupying only 1 int32
#>     1     2     3     4 
#> FALSE  TRUE FALSE  TRUE 
 rep(as.bit(c(FALSE, TRUE)), length.out=7)
#> bit length=7 occupying only 1 int32
#>     1     2     3     4     5     6     7 
#> FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE 
 rep(as.bitwhich(c(FALSE, TRUE)), 2)
#> bitwhich: 2/ 4 occupying only  2 int32 in 1 representation
#>     1     2     3     4 
#> FALSE  TRUE FALSE  TRUE 
 rep(as.bitwhich(c(FALSE, TRUE)), length.out=1)
#> bitwhich: 0/ 1 occupying only  1 int32 in FALSE representation
#>     1 
#> FALSE