rawToSignedInt: Convert a raw vector into signed integers (short)

View source: R/01supporting_functions.r

rawToSignedIntR Documentation

Convert a raw vector into signed integers (short)

Description

This function converts a vector of raw data into signed integer values.

Usage

rawToSignedInt(raw_dat)

Arguments

raw_dat

A vector of raw data.

Details

This function converts a vector of raw data into signed integer values [-128,127]. To convert unsigned integers into raw data use as.raw(x). For the inverse of this function see signedIntToRaw(int_dat).

Value

A vector of the same length as raw_dat, holding signed integer values.

Author(s)

Pepijn de Vries

See Also

Other raw.operations: as.raw(), nybbleToSignedInt(), nybble(), rawToCharNull(), rawToPTModule(), rawToUnsignedInt(), signedIntToNybble(), signedIntToRaw(), unsignedIntToRaw()

Other integer.operations: nybbleToSignedInt(), nybble(), rawToUnsignedInt(), signedIntToNybble(), signedIntToRaw(), unsignedIntToRaw(), waveform()

Examples

## generate some raw data:
some.raw.data <- as.raw(c(0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x90))

## convert the raw data into a vector of signed intgers:
rawToSignedInt(some.raw.data)


ProTrackR documentation built on Aug. 23, 2023, 1:07 a.m.