hex_dec_help | R Documentation |
Convert non-negative whole numbers between decimal and hexadecimal
hex_dec_help()
to_dec(x)
to_hex(x)
todec(x)
tohex(x)
x |
A complete non-negative whole-number object ( |
to_dec()
: Convert hexadecimal numerals to decimal numerals. Returns a non-negative whole-number object.
to_hex()
: Convert decimal numerals to hexadecimal numerals (not prefixed by '#'
). Returns a character object of non-negative whole number hexadecimal values.
todec()
: An alias for to_dec.
tohex()
: An aliax for to_hex.
Other conversions:
rng2lev()
,
tocase()
,
u2u_help()
egHexDec <- function() {
RGBA <- col2rgb("orange", alpha = 0.5)
HEX1 <- rgb(RGBA[1] / 255, RGBA[2] / 255, RGBA[3] / 255, RGBA[4] / 255)
HEX1 <- c(substr(HEX1, 2, 3), substr(HEX1, 4, 5), substr(HEX1, 6, 7), substr(HEX1, 8, 9))
DEC1 <- to_dec(HEX1)
HEX2 <- to_hex(DEC1)
HEX12A <- tohex(12)
DEC12A <- todec(HEX12A)
HEX12B <- tohex(DEC12A)
list(RGBA = RGBA, HEX1 = HEX2, HEX12A = HEX12A, HEX12B = HEX12B, DEC1 = DEC1, DEC12A = DEC12A)
}
egHexDec <- egHexDec()
egHexDec
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.