conversion {chromstaR} | R Documentation |
Convert combinatorial states in decimal representation to combinatorial states in binary representation and vice versa.
dec2bin(dec, colnames = NULL, ndigits = NULL) bin2dec(bin)
dec |
A vector with whole numbers. |
colnames |
The column names for the returned matrix. If specified, |
ndigits |
The number of digits that the binary representation should have. If unspecified, the shortest possible representation will be chosen. |
bin |
A matrix with only 0 and 1 (or TRUE and FALSE) as entries. One combinatorial state per row. |
chromstaR uses decimal numbers to represent combinatorial states of peaks. These functions serve as a convenient way to get from the efficient decimal representation to a more human-readable binary representation.
A vector of integers for bin2dec
and a matrix of logicals with one state per row for dec2bin
.
dec2bin
: Decimal to binary conversion.
bin2dec
: Binary to decimal conversion.
Aaron Taudt
decimal.states <- c(0:31) binary.states <- dec2bin(decimal.states, colnames=paste0('mark',1:5)) control.decimal.states <- bin2dec(binary.states)