View source: R/01supporting_functions.r
nybbleToSignedInt | R Documentation |
Get signed integer values from one or more nybble.
nybbleToSignedInt(raw_dat, which = c("low", "high"))
raw_dat |
|
which |
A |
Nybbles are 4 bit values, where each byte (8 bits) holds two nybbles.
A high nybble (left-hand side of a byte) and a low nybble (right-hand
side of a byte). This function extracts a nybble from raw
data
and converts it into a signed integer
value ranging from -8 up to 7.
Returns integer
values of the same length as raw_dat
,
ranging from -8 up to 7.
Pepijn de Vries
Other nybble.functions:
nybble()
,
signedIntToNybble()
Other raw.operations:
as.raw()
,
nybble()
,
rawToCharNull()
,
rawToPTModule()
,
rawToSignedInt()
,
rawToUnsignedInt()
,
signedIntToNybble()
,
signedIntToRaw()
,
unsignedIntToRaw()
Other integer.operations:
nybble()
,
rawToSignedInt()
,
rawToUnsignedInt()
,
signedIntToNybble()
,
signedIntToRaw()
,
unsignedIntToRaw()
,
waveform()
## generate some raw data:
rdat <- as.raw(255*runif(100))
## get signed integers of low nybbles:
sintl <- nybbleToSignedInt(rdat)
## get signed integers of high nybbles:
sinth <- nybbleToSignedInt(rdat, "high")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.