numToRaw: Numeric to Raw vector

View source: R/numToRaw.R

numToRawR Documentation

Numeric to Raw vector

Description

Convert numeric values to a raw vector.

Usage

  numToRaw(x, nBytes = 1)

Arguments

x

A number to be converted (must be > 0)

nBytes

The number of bytes to use

Value

A raw vector containing the bytes representing x.

Author(s)

Joshua M. Ulrich

See Also

rawToNum

Examples

  # Will be left null padded
  (x <- numToRaw(421,4))
  rawToNum(x,2)
  rawToNum(x,4)

pack documentation built on June 10, 2025, 9:11 a.m.