R: Format bytes as binary [defunct]

byteToBinary {oce} | R Documentation

## Format bytes as binary [defunct]

### Description

WARNING: The `endian` argument will soon be removed from this function; see oce-defunct. This is because the actions for `endian="little"` made no sense in practical work. The default value for `endian` was changed to `"big"` on 2017 May 6.

### Usage

    byteToBinary(x, endian = "big")

### Arguments

`x` | an integer to be interpreted as a byte.
`endian` | character string indicating the endian-ness ("big" or "little"). This argument will be removed in the upcoming CRAN release.

### Value

A character string representing the bit strings for the elements of `x`, in order of significance for the `endian="big"` case. (The nibbles, or 4-bit sequences, are interchanged in the now-deprecated `"little"` case.) See “Examples” for how this relates to the output from rawToBits.

### Author(s)

Dan Kelley

### Examples

    library(oce)
    ## Note comparison with rawToBits():
    a <- as.raw(0x0a)
    byteToBinary(a, "big")        # "00001010"
    as.integer(rev(rawToBits(a))) # 0 0 0 0 1 0 1 0

[Package oce version 1.1-1 Index]