Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

R remove commas

> df <- data.frame(numbers = c("123,456,789", "1,234,567", "1,234", "1"))
> df
      numbers
1 123,456,789
2   1,234,567
3       1,234
4           1
> df$numbers <- as.numeric(gsub(",","",df$numbers))
> df
    numbers
1 123456789
2   1234567
3      1234
4         1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #R #remove #commas
ADD COMMENT
Topic
Name
9+5 =