Learn R Programming

bitstreamio (version 0.1.0)

pad_bits: Pad a logical vector to the given size

Description

Pad a logical vector to the given size

Usage

pad_bits(bits, nbits = 8L, side = "left", value = FALSE)

Value

Logical vector with the specified padding

Arguments

bits

logical vector

nbits

Pad width to a multiple of this number of bits

side

'left' or 'right'. Only the lowercase version of the first letter is used to determine the side. all of these are valid options: 'L', 'R', 'left', 'Right'

value

The value to use for padding. single logical value. Default: FALSE

Examples

Run this code
pad_bits(c(TRUE, TRUE), nbits = 8, side = 'left')
pad_bits(c(TRUE, TRUE), nbits = 8, side = 'R')

Run the code above in your browser using DataLab