Convert signed integers (short) into a raw vector
Source:R/01supporting_functions.r
signedIntToRaw.Rd
This function converts signed integer values into a vector of raw
data.
Details
This function converts signed integer values [-128,127] into a vector of
raw
data. The function
will fail on values that are out of range (< -128 or > 127). To convert
raw data into a vector of unsigned integers use as.integer()
.
For the inverse of this function see rawToSignedInt()
.
See also
Other raw.operations:
as.raw()
,
nybbleToSignedInt()
,
nybble()
,
rawToCharNull()
,
rawToPTModule()
,
rawToSignedInt()
,
rawToUnsignedInt()
,
signedIntToNybble()
,
unsignedIntToRaw()
Other integer.operations:
nybbleToSignedInt()
,
nybble()
,
rawToSignedInt()
,
rawToUnsignedInt()
,
signedIntToNybble()
,
unsignedIntToRaw()
,
waveform()
Examples
## generate some signed integers:
some.integers <- c(-100, 40, 0, 30, -123)
## convert the signed integers into a vector of raw data:
signedIntToRaw(some.integers)
#> [1] 9c 28 00 1e 85