Description Usage Arguments Value Examples
This function turns character variables containing numbers but using a decimal comma, e.g. "1,23" into a numeric.
1 | as_numeric_comma(.x, .group.separator = ".")
|
.x |
Character vector. The first "," of each entry is turned into a "."
and |
.group.separator |
Character value. This character is removed from the input before conversion. Useful to remove "." used as grouping character (e.g. "1.234,56") |
A numeric vector of same length as .x
.
1 2 3 4 5 | as_numeric_comma(c("1,234", "4", "1.234", "1,2,3"))
# .group.separator:
as_numeric_comma(c("1.234,56", "1.234"))
as_numeric_comma(c("1.234,56", "1.234"), .group.separator = ".")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.