Description Usage Arguments Details Value Author(s) See Also Examples
is.xlt
tests whether the function argument is a vector of 32 digit
hexadecimal numbers (a "hexlet").
1 |
s |
(character) a vector of strings to check. |
na.map |
(logical) replace NA with |
is.xlt
accepts a vector of strings and returns a logical vector of the
same length, TRUE
for every element of the input that matches the
regular expression "^[0-9a-f]{32}$"
. NA
values are mapped to
FALSE
(default) or can be replaced with NA
to preserve them.
Note: arguments passed to na.map
are implicitly converted to type
logical.
(logical) a vector of the same length as the input, TRUE
for
every element of the input that is a valid UUID, FALSE
for every
element that is not, and NA
or FALSE
for every NA
input.
(c) 2019 Boris Steipe,
licensed under MIT (see file LICENSE
in this package).
is.QQID()
to check QQIDs.
1 2 3 4 5 6 7 8 9 10 11 | # check the example hexlet formats
is.xlt(xltIDexample()) # TRUE TRUE TRUE TRUE TRUE
# check one invalid format
is.xlt("2.718281828459045235360287471353") # FALSE
# check a valid hexlet, an invalid hexlet, and an NA.
# Map input NA to NA, not to FALSE.
is.xlt(c("0c46:0ed3:b015:adc2:ab4a:01e0:9336:4f1f", # IPv6
"c46:ed3:b015:adc2:ab4a:1e0:9336:4f1f", # IPv6 abbreviated format
NA), na.map = NA) # TRUE FALSE NA
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.