| parse_number_chr | R Documentation |
Parse raw strings as numbers, tolerating decimal commas
parse_number_chr(x)
x |
Character vector. |
Numeric vector, NA where a cell is not a number.
x <- c("1.5", "2,75", " 3 ", "1e2", "unknown", NA)
parsed <- parse_number_chr(x)
parsed
is.na(parsed)
data.frame(raw = x, numeric = parsed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.