as_num | R Documentation |
Coerce a character vector to numeric, by:
- Removing the thousand separator mark.
- Replacing decimal mark with a dot.
- Removing the character "$".
- Removing the characters from the alphabet.
- Trimming extra spaces.
- Applying the function as.numeric.
as_num(x, thousand_mark = "\\.", decimal_mark = "\\,")
x |
A character vector |
thousand_mark |
A character single value to use as the thousand mark (default = '\ \.') |
decimal_mark |
A character single value to use as the decimal mark (default = '\ \,') |
A numeric vector.
x <- "10.000,50"
as_num(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.