strip_alpha | R Documentation |
Given a character vector, these function will strip non-numeric characters from each item and
then attempt to convert the result to either a double using as.double()
or an integer using
as.integer()
.
strip_alpha(x)
parse_double(x)
parse_integer(x)
x |
The character vector to convert. |
For parse_double
and parse_integer
a vector only containing doubles or integers. The
helper function strip_alpha
removes all non-numeric values leaving only numbers, dots (.
for decimals), and hyphens (-
for negative values). The parsers will fail if strip_alpha
yields something non-numeric looking, like "1.1.1".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.