Learn R Programming

fame (version 1.13)

hexidecimal: Hexidecimal conversions

Description

Convert numeric vectors to hexidecimal strings and vice versa.

Usage

hexidecimal(dec)
hex2numeric(hex)

Arguments

dec
numeric vector
hex
character vector of hexidecimal strings

Value

  • hexidecimal returns a character object like dec.

    hex2numeric returns a numeric object like hex.

Details

Hexidecimals are base 16 numbers with digits represented by the characters '0123456789abcdef'. hex2numeric("1df"), for example, is 479 (256 + 13*16 + 15).

Hex numbers are often used to represent bits in a byte, since '9F' takes up less space than '10011111'. TCP/IP port numbers are also often represented in hex.