signedIntToRaw {ProTrackR}R Documentation

Convert signed integers (short) into a raw vector

Description

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

Usage

signedIntToRaw(int_dat)

Arguments

int_dat

A vector of integer values, ranging from -128 up to 127.

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().

Value

A vector of the same length as int_dat, holding raw data.

Author(s)

Pepijn de Vries

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)


[Package ProTrackR version 0.4.3 Index]