Learn R Programming

adfExplorer (version 0.1.8)

displayRawData: Display raw data in a comprehensive way

Description

Cat raw data to the sink in columns with ASCII code

Usage

displayRawData(x, ncol = 4, col.wid = 4, address.len = 3, hex.upper = T)

Value

The character string send to the sink is also returned by the function.

Arguments

x

A vector of class raw to be displayed.

ncol

Number of columns of hexadecimal code to display.

col.wid

Width of each column (in bytes) to display.

address.len

Length of the hexadecimal address (in number of hexadecimal digits) to display.

hex.upper

logical value, to specify whether hexadecimals should be displayed in uppercase (TRUE, default) or lowercase (FALSE).

Author

Pepijn de Vries

Details

As binary data is hard to decipher this function will cat raw data as hexadecimal code in columns, together with the relative (hexadecimal) address of the data and an ASCII translation of the data. Hexadecimals are shown in space separated columns for improved readability. Special characters are replaced by dots in the ASCII representation.

Raw data is padded with zeros at the end to fill remaining columns...

See Also

Other raw.operations: amigaDateToRaw(), amigaIntToRaw(), rawToAmigaDate(), rawToAmigaInt(), rawToBitmap()

Examples

Run this code
## Display some raw random data:
displayRawData(as.raw(sample.int(100)))

## Display the full ASCII table:
displayRawData(as.raw(0:255))

Run the code above in your browser using DataLab