Description Usage Arguments Details Value Author(s) See Also Examples
Read the contents of a file as bytes and create an object containing the raw data, plus optionally an interpretation of the bytes as numeric values, plus parameters controlling how to display the data.
1 2 3 4 |
file |
The name of a file or a connection. |
width |
The number of bytes to print per row when displaying the data. |
offset |
An offset within the file to start reading. |
nbytes |
The number of bytes to read from the file.
|
machine |
How to print each byte when displaying; either
|
human |
How to print a human-readable form of the data;
either |
size |
The number of bytes used to generate each value when interpreting the raw binary as character or numeric data. |
endian |
The endianness of the binary data; used when interpreting bytes as numeric values. |
signed |
Whether the bytes should be interpreted as a signed numeric value. |
Each individual byte is printed in the appropriate machine
format, but there is only one value printed in the appropriate
human
format for every size
bytes. Consequently,
the width
must be a multiple of the size
.
An object of class "rawBlock"
.
Paul Murrell
viewRaw
readBin
as.character.rawBlock
print.rawBlock
blockValue
readFormat
1 2 3 4 5 6 7 | readLines(hexViewFile("rawTest.txt"))
fileBlock <- readRaw(hexViewFile("rawTest.txt"), width=8)
blockValue(fileBlock)
fileBlock <- readRaw(hexViewFile("rawTest.int"), human="int")
blockValue(fileBlock)
|
[1] "test pattern"
[1] "t" "e" "s" "t" " " "p" "a" "t" "t" "e" "r" "n" "."
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.