hex2raw {wkb}R Documentation

Convert String Hex Representation to Raw Vector

Description

Converts a string hexadecimal representation to a raw vector.

Usage

hex2raw(hex)

Arguments

hex

character string or character vector containing a hexadecimal representation.

Details

Non-hexadecimal characters are removed.

Value

A raw vector.

The return value is a list of raw vectors when the argument hex contains more than one hexadecimal representation.

See Also

raw2hex in package PKI, readWKB

Examples

# create a character string containing a hexadecimal representation
hex <- "0101000000000000000000f03f0000000000000840"

# convert to raw vector
wkb <- hex2raw(hex)


# create a character vector containing a hexadecimal representation
hex <- c("01", "01", "00", "00", "00", "00", "00", "00", "00", "00", "00",
         "f0", "3f", "00", "00", "00", "00", "00", "00", "08", "40")

# convert to raw vector
wkb <- hex2raw(hex)


# create vector of two character strings each containing a hex representation
hex <- c("0101000000000000000000f03f0000000000000840",
         "010100000000000000000000400000000000000040")

# convert to list of two raw vectors
wkb <- hex2raw(hex)

[Package wkb version 0.4-0 Index]