bin2ind: convert binary codes to decimal integers

Description Usage Arguments Value Examples

View source: R/utils.R

Description

convert binary codes to decimal integers

Usage

1
bin2ind(mat, LOG = FALSE)

Arguments

mat

A binary matrix; Each row is a binary representation to be converted.

LOG

Take the logarithm of the decimal integer (default is TRUE); otherwise, set to FALSE.

Value

A vector of numbers after conversion (not a matrix)

Examples

1
2
3
bin2ind(c(1,1,1))
bin2ind(rbind(c(1,0,0),c(1,1,0),c(0,0,1),c(1,0,1),c(0,0,0)))
bin2ind(rbind(c(1,0,0),c(1,1,0),c(0,0,1),c(1,0,1),c(0,0,0)),LOG=FALSE)

zhenkewu/slamR documentation built on March 8, 2020, 1:31 a.m.